Skip to content

Commit 53da3df

Browse files
committed
🔧 Do not override onInitCompleted
1 parent 41a34df commit 53da3df

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/hooks/use-front-chat-boot/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ export function useFrontChatBoot(element?: HTMLElement, options?: FrontChatOptio
5959
}
6060

6161
if (cmdType === FrontChatCommandsEnum.INIT) {
62-
const onInitCompleted = () => {
63-
setStatus(FrontChatStatusesEnum.INITIALIZED);
64-
};
62+
const onInitCompleted =
63+
params?.onInitCompleted ??
64+
(() => {
65+
setStatus(FrontChatStatusesEnum.INITIALIZED);
66+
});
6567

6668
return window.FrontChat(cmdType, {...params, onInitCompleted});
6769
}

0 commit comments

Comments
 (0)