refactor: render logic moved into totpRenderer.js

This commit is contained in:
Савелий Савенок
2024-11-19 20:01:36 +03:00
parent fbac44b48b
commit 50de1c0b57
3 changed files with 138 additions and 92 deletions

20
app.js
View File

@@ -4,15 +4,21 @@ import { LocalStorage } from "@zos/storage"
const localStorage = new LocalStorage()
App({
globalData: {
TOTPS: localStorage.getItem('TOTPs') || [
new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'I', 6, 30, 0, 'SHA-1')
]
TOTPS: localStorage.getItem('TOTPs') || []
},
onCreate(options) {
localStorage.setItem('TOTPs', [
])
},
// localStorage.setItem('TOTPs', [
// new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'Iasd', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'Isgfsd', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'Idfklgj', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'Ibcopiu', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'Ioprfhujoidkfmv', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'If', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'I2', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'I3', 6, 30, 0, 'SHA-1'),
// new TOTP('JBSWY3DPEHPK3PXPQ', 'totp.danhersam.com', 'I4', 6, 30, 0, 'SHA-1')
// ])
},
onDestroy(options) {
console.log('app on destroy invoke')