Skip to content

Commit dc0f5ec

Browse files
author
Michael Dijkstra
committed
Update open function
1 parent 81f5dd0 commit dc0f5ec

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/providers/chatwoot.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ const load = ({
5454
}, baseUrl)
5555
}
5656

57-
const open = (): void => window.$chatwoot && window.$chatwoot.toggle()
58-
59-
const close = (): void => window.$chatwoot && window.$chatwoot.toggle()
57+
const open = (): void => {
58+
window.addEventListener('chatwoot:ready', function() {
59+
window.$chatwoot.toggle()
60+
})
61+
}
6062

6163
export default {
6264
domain,
6365
load,
64-
open,
65-
close
66+
open
6667
}

0 commit comments

Comments
 (0)