feat(staging): added transfer for data from settings app(part 2)

This commit is contained in:
Savely Savianok
2024-12-21 18:51:28 +03:00
parent f21678b219
commit 3b2e4992a3
7 changed files with 98 additions and 77 deletions

36
app.js
View File

@@ -1,25 +1,15 @@
import { BaseApp } from "@zeppos/zml/base-app"
import { TOTP } from "./lib/totp-quickjs"
import { LocalStorage } from "@zos/storage"
const localStorage = new LocalStorage()
App({
globalData: {
TOTPS: localStorage.getItem('TOTPs') || []
},
onCreate(options) {
// localStorage.setItem('TOTPs', [
// new TOTP('JBSWY3DPEHPK3PXP', 'totp.danhersam.com', 'I1122222222', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXP', 'totp.danhersam.com', 'I2', 6, 30, 5, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXP', 'totp.danhersam.com', 'I3', 6, 30, -5, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXP', 'totp.danhersam.com', 'I4', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXP', 'totp.danhersam.com', 'I5', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXP', 'totp.danhersam.com', 'I6', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXP', 'totp.danhersam.com', 'I7', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXP', 'totp.danhersam.com', 'I8', 6, 30, 0, 'SHA-1')
// ])
},
onDestroy(options) {
console.log('app on destroy invoke')
}
})
App(
BaseApp(
{
globalData: {
TOTPS: []
},
onCreate() {
},
onDestroy() {
}
})
)