mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-01 16:44:41 +02:00
Add:Theme option setting #916
This commit is contained in:
parent
1cf01a5d12
commit
9298065934
4 changed files with 63 additions and 2 deletions
|
@ -141,6 +141,25 @@ class LocalStorage {
|
|||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async setTheme(theme) {
|
||||
try {
|
||||
await Preferences.set({ key: 'theme', value: theme })
|
||||
console.log('[LocalStorage] Set theme', theme)
|
||||
} catch (error) {
|
||||
console.error('[LocalStorage] Failed to set theme', error)
|
||||
}
|
||||
}
|
||||
|
||||
async getTheme() {
|
||||
try {
|
||||
var obj = await Preferences.get({ key: 'theme' }) || {}
|
||||
return obj.value || null
|
||||
} catch (error) {
|
||||
console.error('[LocalStorage] Failed to get theme', error)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue