improve theme

This commit is contained in:
josc146
2024-03-13 15:36:13 +08:00
parent 3a637a973c
commit cd40261de6
4 changed files with 16 additions and 6 deletions

View File

@@ -127,7 +127,11 @@ if (!window.go) {
return ''
})
defineApp('ReadJson', async (fileName) => {
return JSON.parse(localStorage.getItem(fileName))
const data = JSON.parse(localStorage.getItem(fileName))
if (data)
return data
else
throw new Error('File not found')
})
defineApp('SaveJson', async (fileName, data) => {
localStorage.setItem(fileName, JSON.stringify(data))