diff --git a/src/api/client.js b/src/api/client.js index 7a90a58..2097a7b 100644 --- a/src/api/client.js +++ b/src/api/client.js @@ -90,7 +90,7 @@ apiClient.interceptors.response.use( deleteCookie("luciaToken"); deleteCookie("luciaRefreshToken"); deleteCookie("isLuciaLoggedIn"); - window.location.href = "/login"; + globalThis.location.href = "/login"; return Promise.reject(refreshError); } }, diff --git a/src/utils/jsUtils.js b/src/utils/jsUtils.js index 92e35b9..bd1cac5 100644 --- a/src/utils/jsUtils.js +++ b/src/utils/jsUtils.js @@ -34,6 +34,6 @@ export const printObject = (obj, indent = 0) => { */ export const getRandomInt = (max) => { const array = new Uint32Array(1); - window.crypto.getRandomValues(array); + globalThis.crypto.getRandomValues(array); return Math.floor((array[0] / (0xffffffff + 1)) * (max + 1)); }; diff --git a/src/views/Compare/Dashboard/CompareDashboard.vue b/src/views/Compare/Dashboard/CompareDashboard.vue index 162bc09..007ddfd 100644 --- a/src/views/Compare/Dashboard/CompareDashboard.vue +++ b/src/views/Compare/Dashboard/CompareDashboard.vue @@ -409,7 +409,7 @@ function handleClick(tagId) { isActive.value = tagId; if (isSafeTagId(tagId)) { - window.location.href = tagId; + globalThis.location.href = tagId; } else { console.warn("Unsafe tagId: ", tagId); } diff --git a/src/views/Discover/Performance/PerformancePage.vue b/src/views/Discover/Performance/PerformancePage.vue index 14a9b2e..26ef4e3 100644 --- a/src/views/Discover/Performance/PerformancePage.vue +++ b/src/views/Discover/Performance/PerformancePage.vue @@ -392,7 +392,7 @@ function handleClick(tagId) { isActive.value = tagId; if (isSafeTagId(tagId)) { - window.location.href = tagId; + globalThis.location.href = tagId; } else { console.warn("Unsafe tagId: ", tagId); } diff --git a/src/views/Files/FilesPage.vue b/src/views/Files/FilesPage.vue index d3f7338..2a8c547 100644 --- a/src/views/Files/FilesPage.vue +++ b/src/views/Files/FilesPage.vue @@ -928,7 +928,7 @@ const handleWindowClick = (e) => { onMounted(async () => { isLoading.value = true; await store.fetchAllFiles(); - window.addEventListener("click", handleWindowClick); + globalThis.addEventListener("click", handleWindowClick); // Add the .scrollbar class to the DataTable tbody const tbodyElement = document.querySelector(".p-datatable-tbody"); tbodyElement?.classList.add("scrollbar"); @@ -936,7 +936,7 @@ onMounted(async () => { }); onBeforeUnmount(() => { - window.removeEventListener("click", handleWindowClick); + globalThis.removeEventListener("click", handleWindowClick); });