massively improved initial theme loading code, added checks and warnings when

loading theme files (import/localStorage/defaults)
This commit is contained in:
Henry Jameson 2020-01-22 00:37:19 +02:00
parent 93dfb4d352
commit 9336140486
8 changed files with 259 additions and 72 deletions

View file

@ -5,6 +5,9 @@ const browserLocale = (window.navigator.language || 'en').split('-')[0]
export const defaultState = {
colors: {},
theme: undefined,
customTheme: undefined,
customThemeSource: undefined,
hideISP: false,
// bad name: actually hides posts of muted USERS
hideMutedPosts: undefined, // instance default
@ -93,10 +96,10 @@ const config = {
commit('setOption', { name, value })
switch (name) {
case 'theme':
setPreset(value, commit)
setPreset(value)
break
case 'customTheme':
applyTheme(value, commit)
applyTheme(value)
}
}
}