[Client] Prevent cache locale file

This commit is contained in:
syuilo 2018-11-15 05:20:25 +09:00
parent b4c04efa23
commit 17c6d64750
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69

View file

@ -43,6 +43,9 @@
if (`${url.pathname}/`.startsWith('/admin/')) app = 'admin';
//#endregion
// Script version
const ver = localStorage.getItem('v') || VERSION;
//#region Detect the user language
let lang = null;
@ -67,7 +70,7 @@
let locale = localStorage.getItem('locale');
if (locale == null) {
const locale = await fetch(`/assets/locales/${lang}.json`)
const locale = await fetch(`/assets/locales/${lang}.json?ver=${ver}`)
.then(response => response.json());
localStorage.setItem('locale', JSON.stringify(locale));
@ -98,9 +101,6 @@
app = isMobile ? 'mobile' : 'desktop';
}
// Script version
const ver = localStorage.getItem('v') || VERSION;
// Get salt query
const salt = localStorage.getItem('salt')
? `?salt=${localStorage.getItem('salt')}`