Skip to content

Commit d1390d4

Browse files
authored
Merge pull request #29 from frontapp/v92/fix/no-override-on-init-completed
Do not override onInitCompleted
2 parents 41a34df + e04112d commit d1390d4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
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
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "front-chat-sdk",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Front Chat SDK",
55
"keywords": [
66
"frontapp",

0 commit comments

Comments
 (0)