use separate action for setting Theme V2

appearance-tab
Henry Jameson 2 months ago
parent cd92eb56e0
commit e029732021

@ -499,18 +499,14 @@ export default {
}
},
setCustomTheme () {
this.$store.dispatch('setOption', {
name: 'customTheme',
value: {
this.$store.dispatch('setThemeV2', {
customTheme: {
ignore: true,
themeFileVersion: this.selectedVersion,
themeEngineVersion: CURRENT_VERSION,
...this.previewTheme
}
})
this.$store.dispatch('setOption', {
name: 'customThemeSource',
value: {
},
customThemeSource: {
themeFileVersion: this.selectedVersion,
themeEngineVersion: CURRENT_VERSION,
shadows: this.shadowsLocal,

@ -255,6 +255,11 @@ const config = {
revert
})
},
setThemeV2 ({ commit, dispatch }, { customTheme, customThemeSource }) {
commit('setOption', { name: 'customTheme', value: customTheme })
commit('setOption', { name: 'customThemeSource', value: customThemeSource })
dispatch('setTheme', { themeData: customThemeSource, recompile: true })
},
setOption ({ commit, dispatch, state }, { name, value }) {
const exceptions = new Set([
'useStreamingApi'
@ -272,6 +277,7 @@ const config = {
dispatch('disableMastoSockets')
dispatch('setOption', { name: 'useStreamingApi', value: false })
})
break
}
}
} else {
@ -286,11 +292,6 @@ const config = {
case 'theme':
dispatch('setTheme', { themeName: value, recompile: true })
break
case 'customTheme':
case 'customThemeSource': {
if (!value.ignore) dispatch('setTheme', { themeData: value })
break
}
case 'themeDebug': {
dispatch('setTheme', { recompile: true })
break

@ -255,10 +255,8 @@ const interfaceMod = {
let promise = null
if (themeName) {
// commit('setInstanceOption', { name: 'theme', value: themeName })
promise = getPreset(themeName)
.then(themeData => {
// commit('setInstanceOption', { name: 'themeData', value: themeData })
return normalizeThemeData(themeData)
})
} else if (themeData) {

Loading…
Cancel
Save