diff --git a/src/components/settings_modal/tabs/appearance_tab.js b/src/components/settings_modal/tabs/appearance_tab.js index 7ea4a09ad..d910c79b7 100644 --- a/src/components/settings_modal/tabs/appearance_tab.js +++ b/src/components/settings_modal/tabs/appearance_tab.js @@ -27,10 +27,6 @@ import { import Preview from './theme_tab/theme_preview.vue' -// helper for debugging -// eslint-disable-next-line no-unused-vars -const toValue = (x) => JSON.parse(JSON.stringify(x === undefined ? 'null' : x)) - library.add( faGlobe ) @@ -141,12 +137,11 @@ const AppearanceTab = { cOrange = '#E3FF00' ] = v palette = { key, name, bg, fg, text, link, cRed, cBlue, cGreen, cOrange } + this.bundledPalettes.push() } else { palette = { key, ...v } } - if (!palette.key.startsWith('style.')) { - this.bundledPalettes.push(palette) - } + this.bundledPalettes.push(palette) })) }) @@ -215,7 +210,6 @@ const AppearanceTab = { const result = { name: `${meta.directives.name || this.$t('settings.style.themes3.palette.imported')}: ${variant}`, - key: `style.${variant.toLowerCase().replace(/ /g, '_')}`, bg, fg, text, @@ -323,13 +317,16 @@ const AppearanceTab = { } }, isThemeActive (key) { - return key === (this.mergedConfig.theme || this.$store.state.instance.theme) + const { theme } = this.mergedConfig + return key === theme }, isStyleActive (key) { - return key === (this.mergedConfig.style || this.$store.state.instance.style) + const { style } = this.mergedConfig + return key === style }, isPaletteActive (key) { - return key === (this.mergedConfig.palette || this.$store.state.instance.palette) + const { palette } = this.mergedConfig + return key === palette }, setStyle (name) { this.$store.dispatch('setStyle', name) diff --git a/src/components/settings_modal/tabs/appearance_tab.vue b/src/components/settings_modal/tabs/appearance_tab.vue index d8d3ff158..be05fae09 100644 --- a/src/components/settings_modal/tabs/appearance_tab.vue +++ b/src/components/settings_modal/tabs/appearance_tab.vue @@ -54,7 +54,7 @@ :key="style.key" :data-theme-key="style.key" class="button-default theme-preview" - :class="{ toggled: isStyleActive(style.key) }" + :class="{ toggled: isThemeActive(style.key) }" @click="style.version === 'v2' ? setTheme(style.key) : setStyle(style.key)" > @@ -115,7 +115,7 @@ :key="p.name" class="btn button-default palette-entry" :class="{ toggled: isPaletteActive(p.key) }" - @click="() => setPalette(p.key, p)" + @click="() => setPaletteCustom(p)" >