diff --git a/assets/public/custom/utils.js b/assets/public/custom/utils.js index 4582319d..92f5dc61 100644 --- a/assets/public/custom/utils.js +++ b/assets/public/custom/utils.js @@ -1,9 +1,6 @@ const CONFIG_KEY = "rscord_config"; const DEFAULT_CONFIG = { customCss: "", revertStatusIcons: false }; -window.AUTH_TOKEN = null; -window.localStorage_ = localStorage; - function urlBase64ToUint8Array(base64String) { const padding = "=".repeat((4 - (base64String.length % 4)) % 4); const base64 = (base64String + padding) diff --git a/assets/public/custom/web/main.js b/assets/public/custom/web/main.js index 6a907d46..8f864b8e 100644 --- a/assets/public/custom/web/main.js +++ b/assets/public/custom/web/main.js @@ -1,4 +1,6 @@ (function () { + const { CSS_CLASSES, GLOBAL_ENV } = window; + const BUTTON_ID = "rscord-settings-btn"; const CONTENT_CONTAINER_ID = "custom-content"; const SWITCH_CONTAINER_ID = "switch-container"; @@ -79,7 +81,7 @@ "push-notifications", pushRegistered, async (checked) => { - const publicKey = window.GLOBAL_ENV.VAPID_KEY; + const publicKey = GLOBAL_ENV.VAPID_KEY; if (!publicKey) return false; try { await (checked ? registerPush(publicKey) : unregisterPush()); diff --git a/assets/public/custom/web/switch.js b/assets/public/custom/web/switch.js index acaa8117..768b0dc8 100644 --- a/assets/public/custom/web/switch.js +++ b/assets/public/custom/web/switch.js @@ -1,3 +1,5 @@ +const { CSS_CLASSES } = window; + const ICON_PATHS = { checked: [ "M7.89561 14.8538L6.30462 13.2629L14.3099 5.25755L15.9009 6.84854L7.89561 14.8538Z", diff --git a/assets/public/index.html b/assets/public/index.html index 66b95854..5433e2c1 100644 --- a/assets/public/index.html +++ b/assets/public/index.html @@ -33,6 +33,9 @@ window.GLOBAL_ENV = {}; window.__OVERLAY__ = /overlay/.test(location.pathname) window.__BILLING_STANDALONE__ = /^\/billing/.test(location.pathname) + + window.AUTH_TOKEN = null; + window.localStorage_ = localStorage; function protocolRelative(url) { if (!url) return "";