aboutsummaryrefslogtreecommitdiff
path: root/src/components/settings_modal/tabs/appearance_tab.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/settings_modal/tabs/appearance_tab.js')
-rw-r--r--src/components/settings_modal/tabs/appearance_tab.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/components/settings_modal/tabs/appearance_tab.js b/src/components/settings_modal/tabs/appearance_tab.js
index ef367e41..7ec22641 100644
--- a/src/components/settings_modal/tabs/appearance_tab.js
+++ b/src/components/settings_modal/tabs/appearance_tab.js
@@ -95,7 +95,7 @@ const AppearanceTab = {
if (!isIntersecting) return
const theme = this.availableStyles.find(x => x.key === target.dataset.themeKey)
this.$nextTick(() => {
- theme.ready = true
+ if (theme) theme.ready = true
})
observer.unobserve(target)
})
@@ -144,13 +144,20 @@ const AppearanceTab = {
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
}
},
+ isCustomThemeUsed () {
+ const { theme } = this.mergedConfig
+ return theme === 'custom' || theme === null
+ },
...SharedComputedObject()
},
methods: {
- isThemeActive (key, name) {
- console.log(this.$store.getters.mergedConfig)
- const { customTheme, themeName, customThemeSource } = this.$store.getters.mergedConfig
- console.log(customTheme, customThemeSource, themeName)
+ isThemeActive (key) {
+ const { theme } = this.mergedConfig
+ console.log(key, theme)
+ return key === theme
+ },
+ setTheme (name) {
+ this.$store.dispatch('setTheme', { themeName: name, saveData: true, recompile: true })
},
previewTheme (key, input) {
const style = normalizeThemeData(input)