Skip to content
Snippets Groups Projects
Commit 27297937 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'locale-reset' into 'develop'

Ensure selected locale is not reset to browser default when refreshing app

See merge request funkwhale/funkwhale!879
parents 05e36c74 7f106d21
No related branches found
No related tags found
No related merge requests found
Ensure selected locale is not reset to browser default when refreshing app
......@@ -71,7 +71,9 @@ export default {
created () {
this.openWebsocket()
let self = this
this.autodetectLanguage()
if (!this.$store.state.ui.selectedLanguage) {
this.autodetectLanguage()
}
setInterval(() => {
// used to redraw ago dates every minute
self.$store.commit('ui/computeLastDate')
......
......@@ -40,7 +40,7 @@ export default new Vuex.Store({
}),
createPersistedState({
key: 'ui',
paths: ['ui.currentLanguage', 'ui.momentLocale', 'ui.theme']
paths: ['ui.currentLanguage', 'ui.selectedLanguage', 'ui.momentLocale', 'ui.theme']
}),
createPersistedState({
key: 'radios',
......
......@@ -5,6 +5,7 @@ export default {
namespaced: true,
state: {
currentLanguage: 'en_US',
selectedLanguage: false,
momentLocale: 'en',
lastDate: new Date(),
maxMessages: 100,
......@@ -33,6 +34,7 @@ export default {
},
currentLanguage: (state, value) => {
state.currentLanguage = value
state.selectedLanguage = true
},
momentLocale: (state, value) => {
state.momentLocale = value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment