From b3b20a999a5d59aa2e1bee6489672aac7b8fc90e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 10 Jan 2026 06:05:36 +0000 Subject: [PATCH] Fix clearQueryParams to check window at runtime instead of using isServer constant Replace the pre-evaluated isServer check with a direct typeof window === 'undefined' check to properly handle test scenarios where window is stubbed after module load. Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com> --- web/hooks/use-query-params.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/hooks/use-query-params.ts b/web/hooks/use-query-params.ts index 0749a1ffa5..73798a4a4f 100644 --- a/web/hooks/use-query-params.ts +++ b/web/hooks/use-query-params.ts @@ -21,7 +21,6 @@ import { } from 'nuqs' import { useCallback } from 'react' import { ACCOUNT_SETTING_MODAL_ACTION } from '@/app/components/header/account-setting/constants' -import { isServer } from '@/utils/client' /** * Modal State Query Parameters @@ -177,7 +176,7 @@ export function usePluginInstallation() { * clearQueryParams(['param1', 'param2']) */ export function clearQueryParams(keys: string | string[]) { - if (isServer) + if (typeof window === 'undefined') return const url = new URL(window.location.href)