From 9d3b5af3e3d6ad1f02e06534ecc9f3c77207267c Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Wed, 26 Oct 2022 16:36:54 +1100 Subject: 'localStorage is not defined'? --- assets/preload-plugins/checkLocale.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'assets/preload-plugins/checkLocale.js') 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 -- cgit 1.5.1