H-43: fix WEB Captain takeover E2E flow (#8)
* test(shangwutong): cover CID rename reliability * H-43: fix WEB Captain takeover flow * H-48: preserve compatible provider model * H-49: make Captain takeover atomic * H-50: prevent duplicate widget initialization --------- Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -45,10 +45,18 @@ app.use(
|
||||
|
||||
// Vue.config.productionTip = false;
|
||||
|
||||
window.onload = () => {
|
||||
export const initWidget = () => {
|
||||
if (window.WOOT_WIDGET) return;
|
||||
|
||||
window.WOOT_WIDGET = app.mount('#app');
|
||||
window.actionCable = new ActionCableConnector(
|
||||
window.WOOT_WIDGET,
|
||||
window.chatwootPubsubToken
|
||||
);
|
||||
};
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
window.addEventListener('load', initWidget, { once: true });
|
||||
} else {
|
||||
initWidget();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user