We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6260adc commit ea27111Copy full SHA for ea27111
src/components/askAiSearchParams.tsx
@@ -9,12 +9,14 @@ export default function AskAiSearchParams() {
9
useEffect(() => {
10
const askAi = searchParams?.get('askAI');
11
// Give Kapa.ai some time to be fully loaded
12
- setTimeout(() => {
+ const timer = setTimeout(() => {
13
if (window.Kapa?.open && askAi === 'true') {
14
// open kapa modal
15
window.Kapa.open({});
16
}
17
}, 300);
18
+
19
+ return () => clearTimeout(timer);
20
}, [searchParams]);
21
22
return <Fragment />;
0 commit comments