Skip to content

Commit 2b74932

Browse files
committed
Added some code comments to explain some of the annoying stuff
1 parent b0fa5b0 commit 2b74932

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apps/webapp/app/hooks/useKapaWidget.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export function useKapaWidget() {
9090

9191
window.Kapa("render", {
9292
onRender: () => {
93+
//this auto-opens the Kapa widget on page load if the query contains ?aiHelp=
9394
const aiHelp = searchParams.get("aiHelp");
9495
if (aiHelp) {
9596
setSearchParams((prev) => {
@@ -99,6 +100,7 @@ export function useKapaWidget() {
99100

100101
//we need to decode the aiHelp string because it's urlencoded
101102
const decodedAiHelp = decodeURIComponent(aiHelp);
103+
//sadly this delay is required, otherwise it fails the Kapa browser verification…
102104
setTimeout(() => {
103105
openKapa(decodedAiHelp);
104106
}, 500);

0 commit comments

Comments
 (0)