Skip to content

Commit cb6c54f

Browse files
committed
Fix for search param not working
1 parent 00a6270 commit cb6c54f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

apps/webapp/app/components/AskAI.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,15 @@ function AskAIProvider({ websiteId }: AskAIProviderProps) {
9191
useEffect(() => {
9292
const aiHelp = searchParams.get("aiHelp");
9393
if (aiHelp) {
94-
const decodedAiHelp = decodeURIComponent(aiHelp);
95-
9694
// Delay to avoid hCaptcha bot detection
97-
const timeoutId = window.setTimeout(() => openAskAI(decodedAiHelp), 1000);
95+
window.setTimeout(() => openAskAI(aiHelp), 1000);
9896

9997
// Clone instead of mutating in place
10098
const next = new URLSearchParams(searchParams);
10199
next.delete("aiHelp");
102100
setSearchParams(next);
103-
104-
return () => clearTimeout(timeoutId);
105101
}
106-
}, [searchParams.toString(), openAskAI]);
102+
}, [searchParams, openAskAI]);
107103

108104
return (
109105
<KapaProvider

0 commit comments

Comments
 (0)