aboutsummaryrefslogtreecommitdiff
path: root/src/modules/instance.js
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-02-22 10:57:08 +0200
committerShpuld Shpuldson <shp@cock.li>2020-02-22 10:57:08 +0200
commit5b7acca0bab12e88ad5b2c80b120859e440133de (patch)
tree8936e60ac64ece7195d0dc45ec4fa179c6e6c76b /src/modules/instance.js
parent1fb91b17955219fcf17320806a0d4bf61bf81f5b (diff)
make theme loading work with source-only presets
Diffstat (limited to 'src/modules/instance.js')
-rw-r--r--src/modules/instance.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 8781646d..f96337e4 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -1,5 +1,6 @@
import { set } from 'vue'
import { getPreset, applyTheme } from '../services/style_setter/style_setter.js'
+import { CURRENT_VERSION } from '../services/theme_data/theme_data.service.js'
import { instanceDefaultProperties } from './config.js'
const defaultState = {
@@ -159,7 +160,14 @@ const instance = {
// No need to apply theme if there's user theme already
const { customTheme } = rootState.config
if (customTheme) return
- applyTheme(themeData.theme)
+
+ // New theme presets don't have 'theme' property, they use 'source'
+ const themeSource = themeData.source
+ if (themeSource && themeSource.themeEngineVersion === CURRENT_VERSION) {
+ applyTheme(themeSource)
+ } else {
+ applyTheme(themeData.theme)
+ }
})
},
fetchEmoji ({ dispatch, state }) {