Compare commits
5 Commits
snoot
...
fix/persis
Author | SHA1 | Date |
---|---|---|
eal | 288a8edf9d | |
eal | ff8e3b5458 | |
eal | 798af7bb5b | |
eal | 39136c7a0b | |
eal | 93603a9c14 |
|
@ -14,6 +14,12 @@ export default {
|
|||
data: () => ({
|
||||
mobileActivePanel: 'timeline'
|
||||
}),
|
||||
created () {
|
||||
const savedTheme = this.$store.state.config.savedTheme
|
||||
if (savedTheme && (savedTheme !== this.$store.config.theme)) {
|
||||
this.$store.dispatch('setOption', { name: 'theme', value: savedTheme })
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
currentUser () { return this.$store.state.users.currentUser },
|
||||
background () {
|
||||
|
|
|
@ -14,6 +14,7 @@ export default {
|
|||
watch: {
|
||||
selected () {
|
||||
this.$store.dispatch('setOption', { name: 'theme', value: this.selected })
|
||||
this.$store.dispatch('setOption', { name: 'savedTheme', value: this.selected })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ const persistedStateOptions = {
|
|||
'config.autoLoad',
|
||||
'config.hoverPreview',
|
||||
'config.muteWords',
|
||||
'config.savedTheme',
|
||||
'statuses.notifications',
|
||||
'users.users'
|
||||
]
|
||||
|
@ -89,8 +90,9 @@ new Vue({
|
|||
window.fetch('/static/config.json')
|
||||
.then((res) => res.json())
|
||||
.then(({name, theme, background, logo, registrationOpen}) => {
|
||||
const themeToSet = store.state.config.savedTheme || theme
|
||||
store.dispatch('setOption', { name: 'name', value: name })
|
||||
store.dispatch('setOption', { name: 'theme', value: theme })
|
||||
store.dispatch('setOption', { name: 'theme', value: themeToSet })
|
||||
store.dispatch('setOption', { name: 'background', value: background })
|
||||
store.dispatch('setOption', { name: 'logo', value: logo })
|
||||
store.dispatch('setOption', { name: 'registrationOpen', value: registrationOpen })
|
||||
|
|
Loading…
Reference in New Issue