TOTPFit/page/index.js

23 lines
494 B
JavaScript
Raw Normal View History

import { setStatusBarVisible } from '@zos/ui'
import { RenderAddButton } from './render/totpRenderer'
import { initLoop } from './render/index/renderer'
2024-11-13 18:12:34 +03:00
const app = getApp()
Page({
2024-11-13 18:12:34 +03:00
onInit() {
//If app has no saved TOTPs
if (app._options.globalData.TOTPS.length < 1)
2024-11-13 18:12:34 +03:00
setStatusBarVisible(true)
else
setStatusBarVisible(false)
},
build() {
const buffer = app._options.globalData.TOTPS
if (buffer.length < 1)
RenderAddButton('page/tip')
else{
initLoop(buffer)
2024-11-13 18:12:34 +03:00
}
}
})