update to palettes GUI + disable theme-setting stuff while change is in progress

This commit is contained in:
Henry Jameson 2024-12-26 23:45:43 +02:00
commit 6a1a3ebf13
5 changed files with 94 additions and 60 deletions

View file

@ -10,6 +10,7 @@ const toValue = (x) => JSON.parse(JSON.stringify(x === undefined ? 'null' : x))
const defaultState = {
localFonts: null,
themeApplied: false,
themeChangeInProgress: false,
themeVersion: 'v3',
styleNameUsed: null,
styleDataUsed: null,
@ -556,11 +557,13 @@ const interfaceMod = {
themeDebug,
theme3hacks
} = rootState.config
state.themeChangeInProgress = true
// If we're not not forced to recompile try using
// cache (tryLoadCache return true if load successful)
const forceRecompile = forceThemeRecompilation || recompile
if (!forceRecompile && !themeDebug && await tryLoadCache()) {
state.themeChangeInProgress = false
return commit('setThemeApplied')
}
window.splashUpdate('splash.theme')
@ -669,7 +672,9 @@ const interfaceMod = {
return applyTheme(
rulesetArray.flat(),
() => commit('setThemeApplied'),
() => {},
() => {
state.themeChangeInProgress = false
},
themeDebug
)
} catch (e) {