made theme debug easier by making it an actual option

This commit is contained in:
Henry Jameson 2024-06-21 23:28:24 +03:00
commit f9e407de63
9 changed files with 53 additions and 31 deletions

View file

@ -353,18 +353,20 @@ const afterStoreSetup = async ({ store, i18n }) => {
await setConfig({ store })
const { customTheme, customThemeSource, forceThemeRecompilation } = store.state.config
const { customTheme, customThemeSource, forceThemeRecompilation, themeDebug } = store.state.config
const { theme } = store.state.instance
const customThemePresent = customThemeSource || customTheme
if (!forceThemeRecompilation && tryLoadCache()) {
console.log('DEBUG INITIAL', themeDebug, forceThemeRecompilation)
if (!forceThemeRecompilation && !themeDebug && tryLoadCache()) {
store.commit('setThemeApplied')
} else {
if (customThemePresent) {
if (customThemeSource && customThemeSource.themeEngineVersion === CURRENT_VERSION) {
applyTheme(customThemeSource)
applyTheme(customThemeSource, () => {}, themeDebug)
} else {
applyTheme(customTheme)
applyTheme(customTheme, () => {}, themeDebug)
}
store.commit('setThemeApplied')
} else if (theme) {