diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-10-26 16:36:54 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-10-26 16:36:54 +1100 |
commit | 9cd27dad6fd8e054637e93492e7c0971067a461d (patch) | |
tree | f5476c4933de301e12c0ffc23a009bb56c31ebc1 /assets/preload-plugins/checkLocale.js | |
parent | handle a specific case with rtl character (diff) | |
download | server-9cd27dad6fd8e054637e93492e7c0971067a461d.tar.xz |
'localStorage is not defined'?
Diffstat (limited to 'assets/preload-plugins/checkLocale.js')
-rw-r--r-- | assets/preload-plugins/checkLocale.js | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/assets/preload-plugins/checkLocale.js b/assets/preload-plugins/checkLocale.js index 0fbc73ee..1b5e7b71 100644 --- a/assets/preload-plugins/checkLocale.js +++ b/assets/preload-plugins/checkLocale.js @@ -1,11 +1,3 @@ -// TODO: remote auth -// window.GLOBAL_ENV.REMOTE_AUTH_ENDPOINT = window.GLOBAL_ENV.GATEWAY_ENDPOINT.replace(/wss?:/, ""); -localStorage.setItem("gatewayURL", window.GLOBAL_ENV.GATEWAY_ENDPOINT); -localStorage.setItem( - "DeveloperOptionsStore", - `{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}` -); - const supportedLocales = [ "bg", "cs", @@ -38,9 +30,9 @@ const supportedLocales = [ "zh-TW" ]; -const settings = JSON.parse(localStorage.getItem("UserSettingsStore")); +const settings = JSON.parse(window.localStorage.getItem("UserSettingsStore")); if (settings && !supportedLocales.includes(settings.locale)) { // fix client locale wrong and client not loading at all settings.locale = "en-US"; - localStorage.setItem("UserSettingsStore", JSON.stringify(settings)); + window.localStorage.setItem("UserSettingsStore", JSON.stringify(settings)); } \ No newline at end of file |