aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2024-06-21 23:28:24 +0300
committerHenry Jameson <me@hjkos.com>2024-06-21 23:28:24 +0300
commitf9e407de639ce4d20beacd3eca3501639ae161bd (patch)
tree49906abb3967f86c968555c3bf8f91553fde63df /src/modules
parenteed05f1380fd60f9564558c82f142c317ef670f5 (diff)
made theme debug easier by making it an actual option
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/config.js12
-rw-r--r--src/modules/instance.js6
2 files changed, 13 insertions, 5 deletions
diff --git a/src/modules/config.js b/src/modules/config.js
index 2623bc26..a977c9c5 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -147,6 +147,7 @@ export const defaultState = {
maxDepthInThread: undefined, // instance default
autocompleteSelect: undefined, // instance default
closingDrawerMarksAsSeen: undefined, // instance default
+ themeDebug: false,
unseenAtTop: undefined, // instance default
ignoreInactionableSeen: undefined // instance default
}
@@ -274,9 +275,16 @@ const config = {
applyConfig(state)
break
case 'customTheme':
- case 'customThemeSource':
- applyTheme(value)
+ case 'customThemeSource': {
+ const { themeDebug } = state
+ applyTheme(value, () => {}, themeDebug)
break
+ }
+ case 'themeDebug': {
+ const { customTheme, customThemeSource } = state
+ applyTheme(customTheme || customThemeSource, () => {}, value)
+ break
+ }
case 'interfaceLanguage':
messages.setLanguage(this.getters.i18n, value)
dispatch('loadUnicodeEmojiData', value)
diff --git a/src/modules/instance.js b/src/modules/instance.js
index e28837b3..6997e75d 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -383,16 +383,16 @@ const instance = {
.then(themeData => {
commit('setInstanceOption', { name: 'themeData', value: themeData })
// No need to apply theme if there's user theme already
- const { customTheme } = rootState.config
+ const { customTheme, themeDebug } = rootState.config
const { themeApplied } = rootState.interface
if (customTheme || themeApplied) return
// New theme presets don't have 'theme' property, they use 'source'
const themeSource = themeData.source
if (!themeData.theme || (themeSource && themeSource.themeEngineVersion === CURRENT_VERSION)) {
- applyTheme(themeSource)
+ applyTheme(themeSource, null, themeDebug)
} else {
- applyTheme(themeData.theme)
+ applyTheme(themeData.theme, null, themeDebug)
}
commit('setThemeApplied')
})