2024-12-21 17:56:45 +03:00
|
|
|
import { setStatusBarVisible } from '@zos/ui'
|
|
|
|
import { RenderAddButton } from './render/totpRenderer'
|
2024-11-19 20:30:24 +03:00
|
|
|
import { initLoop } from './render/index/renderer'
|
2024-11-09 16:37:03 +03:00
|
|
|
|
2024-11-13 18:12:34 +03:00
|
|
|
const app = getApp()
|
2024-11-09 16:37:03 +03:00
|
|
|
|
|
|
|
Page({
|
2024-11-13 18:12:34 +03:00
|
|
|
onInit() {
|
2024-11-19 20:01:36 +03:00
|
|
|
//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
|
2024-11-19 20:30:24 +03:00
|
|
|
if (buffer.length < 1)
|
2024-11-19 20:01:36 +03:00
|
|
|
RenderAddButton('page/tip')
|
2024-11-19 20:30:24 +03:00
|
|
|
else{
|
|
|
|
initLoop(buffer)
|
2024-11-13 18:12:34 +03:00
|
|
|
}
|
|
|
|
}
|
2024-12-21 17:56:45 +03:00
|
|
|
})
|