Ensure selected locale is not reset to browser default when refreshing app
This commit is contained in:
parent
39f6f51e4e
commit
7f106d21c4
|
@ -0,0 +1 @@
|
||||||
|
Ensure selected locale is not reset to browser default when refreshing app
|
|
@ -71,7 +71,9 @@ export default {
|
||||||
created () {
|
created () {
|
||||||
this.openWebsocket()
|
this.openWebsocket()
|
||||||
let self = this
|
let self = this
|
||||||
|
if (!this.$store.state.ui.selectedLanguage) {
|
||||||
this.autodetectLanguage()
|
this.autodetectLanguage()
|
||||||
|
}
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
// used to redraw ago dates every minute
|
// used to redraw ago dates every minute
|
||||||
self.$store.commit('ui/computeLastDate')
|
self.$store.commit('ui/computeLastDate')
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default new Vuex.Store({
|
||||||
}),
|
}),
|
||||||
createPersistedState({
|
createPersistedState({
|
||||||
key: 'ui',
|
key: 'ui',
|
||||||
paths: ['ui.currentLanguage', 'ui.momentLocale', 'ui.theme']
|
paths: ['ui.currentLanguage', 'ui.selectedLanguage', 'ui.momentLocale', 'ui.theme']
|
||||||
}),
|
}),
|
||||||
createPersistedState({
|
createPersistedState({
|
||||||
key: 'radios',
|
key: 'radios',
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
currentLanguage: 'en_US',
|
currentLanguage: 'en_US',
|
||||||
|
selectedLanguage: false,
|
||||||
momentLocale: 'en',
|
momentLocale: 'en',
|
||||||
lastDate: new Date(),
|
lastDate: new Date(),
|
||||||
maxMessages: 100,
|
maxMessages: 100,
|
||||||
|
@ -33,6 +34,7 @@ export default {
|
||||||
},
|
},
|
||||||
currentLanguage: (state, value) => {
|
currentLanguage: (state, value) => {
|
||||||
state.currentLanguage = value
|
state.currentLanguage = value
|
||||||
|
state.selectedLanguage = true
|
||||||
},
|
},
|
||||||
momentLocale: (state, value) => {
|
momentLocale: (state, value) => {
|
||||||
state.momentLocale = value
|
state.momentLocale = value
|
||||||
|
|
Loading…
Reference in New Issue