fix: custom locale not being set until the settings tab is open
This commit is contained in:
parent
53735647f9
commit
0eb0ebcbc9
File diff suppressed because one or more lines are too long
21
src/app.js
21
src/app.js
@ -21,10 +21,19 @@ import EventBus from '@/utils/EventBus.js'
|
|||||||
/* ===== App initialization ===== */
|
/* ===== App initialization ===== */
|
||||||
|
|
||||||
function startApp() {
|
function startApp() {
|
||||||
|
setLocale()
|
||||||
mountApp()
|
mountApp()
|
||||||
initTabs()
|
initTabs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setLocale() {
|
||||||
|
let storedLocale = localStorage.getItem('locale')
|
||||||
|
|
||||||
|
if (storedLocale) {
|
||||||
|
i18n.locale = storedLocale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function mountApp() {
|
function mountApp() {
|
||||||
new Vue({
|
new Vue({
|
||||||
store,
|
store,
|
||||||
@ -120,11 +129,13 @@ socket.on('logged_in', function(data) {
|
|||||||
break
|
break
|
||||||
case -1:
|
case -1:
|
||||||
toast(i18n.t('toasts.deezerNotAvailable'), 'close', true, 'login-toast')
|
toast(i18n.t('toasts.deezerNotAvailable'), 'close', true, 'login-toast')
|
||||||
$('#open_login_prompt').show()
|
return
|
||||||
document.getElementById('logged_in_info').classList.add('hide')
|
// TODO
|
||||||
$('#settings_username').text('Not Logged')
|
// $('#open_login_prompt').show()
|
||||||
$('#settings_picture').attr('src', `https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`)
|
// document.getElementById('logged_in_info').classList.add('hide')
|
||||||
document.getElementById('home_not_logged_in').classList.remove('hide')
|
// $('#settings_username').text('Not Logged')
|
||||||
|
// $('#settings_picture').attr('src', `https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`)
|
||||||
|
// document.getElementById('home_not_logged_in').classList.remove('hide')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -722,7 +722,6 @@ export default {
|
|||||||
let storedLocale = localStorage.getItem('locale')
|
let storedLocale = localStorage.getItem('locale')
|
||||||
|
|
||||||
if (storedLocale) {
|
if (storedLocale) {
|
||||||
this.$i18n.locale = storedLocale
|
|
||||||
this.currentLocale = storedLocale
|
this.currentLocale = storedLocale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user