chore: prettier cleanup
This commit is contained in:
@@ -13,23 +13,22 @@ Page(
|
||||
this.getTOTPData()
|
||||
.then((x) => {
|
||||
app._options.globalData.TOTPS = JSON.parse(x) ?? [];
|
||||
|
||||
|
||||
let localStorage = new LocalStorage();
|
||||
localStorage.setItem(
|
||||
"TOTPs",
|
||||
JSON.stringify(app._options.globalData.TOTPS)
|
||||
JSON.stringify(app._options.globalData.TOTPS),
|
||||
);
|
||||
this.initPage();
|
||||
})
|
||||
.catch((x) => {
|
||||
console.log(`Init failed: ${x}`);
|
||||
try{
|
||||
try {
|
||||
let localStorage = new LocalStorage();
|
||||
app._options.globalData.TOTPS = JSON.parse(
|
||||
localStorage.getItem("TOTPs", [])
|
||||
localStorage.getItem("TOTPs", []),
|
||||
);
|
||||
}
|
||||
catch{
|
||||
} catch {
|
||||
app._options.globalData.TOTPS = [];
|
||||
}
|
||||
this.initPage();
|
||||
@@ -56,5 +55,5 @@ Page(
|
||||
method: "totps",
|
||||
});
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ function renderTOTPs(buffer) {
|
||||
expireBar: RenderExpireBar(
|
||||
i,
|
||||
otpData.createdTime,
|
||||
buffer[i].fetchTime
|
||||
buffer[i].fetchTime,
|
||||
),
|
||||
};
|
||||
setInterval(() => {
|
||||
@@ -38,7 +38,7 @@ function renderTOTPs(buffer) {
|
||||
(Date.now() - otpData.createdTime) /
|
||||
1000 /
|
||||
buffer[i].fetchTime -
|
||||
1
|
||||
1,
|
||||
);
|
||||
|
||||
renderData[i].expireBar.setProperty(prop.MORE, {
|
||||
|
||||
@@ -77,7 +77,7 @@ export function RenderOTPValue(position, otpValue) {
|
||||
export function RenderExpireBar(position, createdTime, fetchTime) {
|
||||
const yPos = getYPos(position);
|
||||
const expireDif = Math.abs(
|
||||
(Date.now() - createdTime) / 1000 / fetchTime - 1
|
||||
(Date.now() - createdTime) / 1000 / fetchTime - 1,
|
||||
);
|
||||
return createWidget(widget.ARC, {
|
||||
x: buttonWidth - 50,
|
||||
|
||||
@@ -27,5 +27,5 @@ Page(
|
||||
text: "To add TOTP record open\n settings on Zepp app",
|
||||
});
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user