Skip to content

Commit 8109cdc

Browse files
refactor: remove isLoadTimer function to streamline Chatwoot loading logic
1 parent 2cc27c0 commit 8109cdc

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/runtime/vue/vue.ts

-27
Original file line numberDiff line numberDiff line change
@@ -361,33 +361,6 @@ export function useChatWoot() {
361361
}
362362
}
363363

364-
function isLoadTimer() {
365-
return new Promise((resolve, reject) => {
366-
let loadNumber = 0
367-
const timer = setInterval(() => {
368-
const data = document.querySelector('.woot-widget-holder')
369-
const widgetElm = document.querySelector('.woot--bubble-holder')
370-
371-
loadNumber += 1
372-
373-
if (
374-
data
375-
&& window.chatwootSDK
376-
&& widgetElm
377-
&& window.$chatwoot
378-
&& window
379-
) {
380-
clearInterval(timer)
381-
resolve('Chatwoot loaded')
382-
}
383-
else if (loadNumber === 200) {
384-
clearInterval(timer)
385-
reject(new Error('Chatwoot not loaded'))
386-
}
387-
}, 150)
388-
})
389-
}
390-
391364
declare module 'vue' {
392365
interface ComponentCustomProperties {
393366
$chatwoot: OptionPlugin

0 commit comments

Comments
 (0)