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
23
src/app.js
23
src/app.js
@ -21,10 +21,19 @@ import EventBus from '@/utils/EventBus.js'
|
||||
/* ===== App initialization ===== */
|
||||
|
||||
function startApp() {
|
||||
setLocale()
|
||||
mountApp()
|
||||
initTabs()
|
||||
}
|
||||
|
||||
function setLocale() {
|
||||
let storedLocale = localStorage.getItem('locale')
|
||||
|
||||
if (storedLocale) {
|
||||
i18n.locale = storedLocale
|
||||
}
|
||||
}
|
||||
|
||||
function mountApp() {
|
||||
new Vue({
|
||||
store,
|
||||
@ -63,7 +72,7 @@ document.addEventListener('paste', pasteEvent => {
|
||||
})
|
||||
|
||||
document.addEventListener('keydown', e => {
|
||||
if(e.keyCode == 70 && e.ctrlKey){
|
||||
if (e.keyCode == 70 && e.ctrlKey) {
|
||||
e.preventDefault()
|
||||
document.querySelector('#searchbar').focus()
|
||||
}
|
||||
@ -120,11 +129,13 @@ socket.on('logged_in', function(data) {
|
||||
break
|
||||
case -1:
|
||||
toast(i18n.t('toasts.deezerNotAvailable'), 'close', true, 'login-toast')
|
||||
$('#open_login_prompt').show()
|
||||
document.getElementById('logged_in_info').classList.add('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')
|
||||
return
|
||||
// TODO
|
||||
// $('#open_login_prompt').show()
|
||||
// document.getElementById('logged_in_info').classList.add('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')
|
||||
|
||||
if (storedLocale) {
|
||||
this.$i18n.locale = storedLocale
|
||||
this.currentLocale = storedLocale
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user