Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

replace window

Bill Yangccbd98782e2f
diff --git a/client/src/app/settings/account/components/AccountInner.tsx b/client/src/app/settings/account/components/AccountInner.tsx
index 38dcfa97a..b028cf4c3 100644
--- a/client/src/app/settings/account/components/AccountInner.tsx
+++ b/client/src/app/settings/account/components/AccountInner.tsx
@@ -44,7 +44,7 @@ export function AccountInner({
}
toast.success("Name updated successfully");
- window.location.reload();
+ globalThis.location.reload();
} catch (error) {
console.error("Error updating name:", error);
toast.error(
@@ -74,7 +74,7 @@ export function AccountInner({
toast.success("Username updated successfully");
// Reload the page to refresh the session
- window.location.reload();
+ globalThis.location.reload();
} catch (error) {
console.error("Error updating username:", error);
toast.error(
@@ -109,7 +109,7 @@ export function AccountInner({
toast.success("Email updated successfully");
// Reload the page to refresh the session
- window.location.reload();
+ globalThis.location.reload();
} catch (error) {
console.error("Error updating email:", error);
toast.error(
diff --git a/client/src/app/subscribe/page.tsx b/client/src/app/subscribe/page.tsx
index 00670ca63..71cd31f68 100644
--- a/client/src/app/subscribe/page.tsx
+++ b/client/src/app/subscribe/page.tsx
@@ -324,7 +324,7 @@ export default function Subscribe() {
// Handle contact for enterprise
function handleContactEnterprise(): void {
- window.location.href = "/contact";
+ globalThis.location.href = "/contact";
}
// Handle slider changes
diff --git a/client/src/lib/store.ts b/client/src/lib/store.ts
index 3ba158a45..e0511134e 100644
--- a/client/src/lib/store.ts
+++ b/client/src/lib/store.ts
@@ -106,7 +106,7 @@ export const useStore = create<Store>((set) => ({
// Get current URL search params to check for stored state
let urlParams: URLSearchParams | null = null;
if (typeof window !== "undefined") {
- urlParams = new URLSearchParams(window.location.search);
+ urlParams = new URLSearchParams(globalThis.location.search);
}
// Check if we have state stored in the URL