fix, chore, feat: refactor of settings app, fix of Google Auth migration parse, added rename button(testing), added sort feature, added timeout to screen turning off, formated codes with space between 6-digits codes
Co-authored-by: DemiarUA <demiar97@gmail.com> https://github.com/Lisoveliy/totpfit/pull/1
This commit is contained in:
@@ -2,34 +2,37 @@ import { RenderAddButton } from "./render/totpRenderer";
|
||||
import { initLoop } from "./render/index/renderer";
|
||||
import { BasePage } from "@zeppos/zml/base-page";
|
||||
import { LocalStorage } from "@zos/storage";
|
||||
import { setPageBrightTime } from "@zos/display";
|
||||
|
||||
const app = getApp();
|
||||
|
||||
const brightTimeMs = 300000;
|
||||
|
||||
let waitForFetch = true;
|
||||
|
||||
Page(
|
||||
BasePage({
|
||||
onInit() {
|
||||
setPageBrightTime({ brightTime: brightTimeMs });
|
||||
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 +59,5 @@ Page(
|
||||
method: "totps",
|
||||
});
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user