fix: fixed application crash when count is zero
This commit is contained in:
parent
14cc456d0e
commit
3c5dc5276d
@ -11,8 +11,8 @@ Page(
|
|||||||
onInit() {
|
onInit() {
|
||||||
this.getTOTPData().then((x) => {
|
this.getTOTPData().then((x) => {
|
||||||
console.log(x)
|
console.log(x)
|
||||||
localStorage.setItem('TOTPs', x)
|
localStorage.setItem('TOTPs', x ?? [])
|
||||||
app._options.globalData.TOTPS = x
|
app._options.globalData.TOTPS = x ?? []
|
||||||
this.initPage();
|
this.initPage();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
@ -5,7 +5,7 @@ let _props = null;
|
|||||||
AppSettingsPage({
|
AppSettingsPage({
|
||||||
build(props) {
|
build(props) {
|
||||||
_props = props;
|
_props = props;
|
||||||
const storage = props.settingsStorage.getItem("TOTPs")
|
const storage = props.settingsStorage.getItem("TOTPs") ?? []
|
||||||
const totpEntrys = GetTOTPList(storage)
|
const totpEntrys = GetTOTPList(storage)
|
||||||
const createButton = TextInput({
|
const createButton = TextInput({
|
||||||
placeholder: "otpauth://",
|
placeholder: "otpauth://",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user