mirror of
https://example.com
synced 2024-11-24 15:26:39 +09:00
[Client] Prevent cache locale file
This commit is contained in:
parent
b4c04efa23
commit
17c6d64750
1 changed files with 4 additions and 4 deletions
|
@ -43,6 +43,9 @@
|
||||||
if (`${url.pathname}/`.startsWith('/admin/')) app = 'admin';
|
if (`${url.pathname}/`.startsWith('/admin/')) app = 'admin';
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
// Script version
|
||||||
|
const ver = localStorage.getItem('v') || VERSION;
|
||||||
|
|
||||||
//#region Detect the user language
|
//#region Detect the user language
|
||||||
let lang = null;
|
let lang = null;
|
||||||
|
|
||||||
|
@ -67,7 +70,7 @@
|
||||||
|
|
||||||
let locale = localStorage.getItem('locale');
|
let locale = localStorage.getItem('locale');
|
||||||
if (locale == null) {
|
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());
|
.then(response => response.json());
|
||||||
|
|
||||||
localStorage.setItem('locale', JSON.stringify(locale));
|
localStorage.setItem('locale', JSON.stringify(locale));
|
||||||
|
@ -98,9 +101,6 @@
|
||||||
app = isMobile ? 'mobile' : 'desktop';
|
app = isMobile ? 'mobile' : 'desktop';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Script version
|
|
||||||
const ver = localStorage.getItem('v') || VERSION;
|
|
||||||
|
|
||||||
// Get salt query
|
// Get salt query
|
||||||
const salt = localStorage.getItem('salt')
|
const salt = localStorage.getItem('salt')
|
||||||
? `?salt=${localStorage.getItem('salt')}`
|
? `?salt=${localStorage.getItem('salt')}`
|
||||||
|
|
Loading…
Reference in a new issue