feat: fixed reset of app settings
This commit is contained in:
parent
999c47789b
commit
3c8c804fc3
@ -9,6 +9,7 @@ AppSideService(
|
||||
onRequest(req, res){
|
||||
if(req.method === 'totps'){
|
||||
console.log(req)
|
||||
console.log(`sending response: ${settings.settingsStorage.getItem('TOTPs')}`)
|
||||
res(null, settings.settingsStorage.getItem('TOTPs'))
|
||||
}
|
||||
},
|
||||
|
@ -9,10 +9,11 @@ Page(
|
||||
onInit() {
|
||||
this.getTOTPData().then((x) => {
|
||||
console.log(x)
|
||||
app._options.globalData.TOTPS = x ?? []
|
||||
app._options.globalData.TOTPS = JSON.parse(x) ?? []
|
||||
this.initPage()
|
||||
})
|
||||
.catch(() => {
|
||||
.catch((x) => {
|
||||
console.log(x)
|
||||
app._options.globalData.TOTPS = []
|
||||
this.initPage()
|
||||
})
|
||||
|
@ -6,7 +6,8 @@ AppSettingsPage({
|
||||
build(props) {
|
||||
_props = props;
|
||||
|
||||
const storage = props.settingsStorage.getItem("TOTPs") ?? []
|
||||
console.log(props.settingsStorage.getItem("TOTPs"))
|
||||
const storage = JSON.parse(props.settingsStorage.getItem("TOTPs") ?? "[]")
|
||||
const totpEntrys = GetTOTPList(storage)
|
||||
const createButton = TextInput({
|
||||
placeholder: "otpauth://",
|
||||
@ -160,5 +161,5 @@ function GetTOTPList(storage){
|
||||
function updateStorage(storage){
|
||||
console.log("new storage is:")
|
||||
console.log(storage)
|
||||
_props.settingsStorage.setItem('TOTPs', storage)
|
||||
_props.settingsStorage.setItem('TOTPs', JSON.stringify(storage))
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user