v1.1.0 Release #3

Merged
Lisoveliy merged 3 commits from dev into main 2025-02-26 00:01:56 +01:00
2 changed files with 8 additions and 3 deletions
Showing only changes of commit 5fa5455e00 - Show all commits

View File

@ -13,7 +13,8 @@
"description": "TOTP Authenticator for Amazfit devices"
},
"permissions": [
"data:os.device.info"
"data:os.device.info",
"device:os.local_storage"
],
"runtime": {
"apiVersion": {

View File

@ -1,19 +1,23 @@
import { RenderAddButton } from "./render/totpRenderer";
import { initLoop } from "./render/index/renderer";
import { BasePage } from "@zeppos/zml/base-page";
import { LocalStorage } from '@zos/storage';
const app = getApp();
let waitForFetch = true;
let localStorage = new LocalStorage();
Page(
BasePage({
onInit() {
this.getTOTPData()
.then((x) => {
app._options.globalData.TOTPS = JSON.parse(x) ?? [];
app._options.globalData.TOTPS = JSON.parse(x) ?? []
localStorage.setItem('TOTPs', JSON.stringify(app._options.globalData.TOTPS))
this.initPage();
})
.catch((x) => {
app._options.globalData.TOTPS = [];
console.log(`Init failed: ${x}`)
app._options.globalData.TOTPS = JSON.parse(localStorage.getItem('TOTPs', null) ?? []);
this.initPage();
});
},