Commit bf4c5e45 authored by Muhammadali's avatar Muhammadali

update-

parent 1d3e98cd
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "4.6.5", "version": "4.6.6",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
...@@ -240,6 +240,14 @@ export class BoxDialer { ...@@ -240,6 +240,14 @@ export class BoxDialer {
}; };
} }
isUaRunning() {
return (
typeof BX !== 'undefined' &&
window.localStorage.getItem(BX.bitrix_sessid() + '_mycall') &&
window.localStorage.getItem('mycall')
);
}
removeViExternalCard() { removeViExternalCard() {
// if ( // if (
// typeof BX !== 'undefined' && // typeof BX !== 'undefined' &&
...@@ -247,10 +255,8 @@ export class BoxDialer { ...@@ -247,10 +255,8 @@ export class BoxDialer {
// window.localStorage.getItem('mycall') // window.localStorage.getItem('mycall')
// ) { // ) {
// BX?.localStorage?.remove('viExternalCard'); // BX?.localStorage?.remove('viExternalCard');
// } else if (typeof BX !== 'undefined') { // } else if (typeof BX !== 'undefined') {
// BX?.localStorage?.remove('viExternalCard'); // BX?.localStorage?.remove('viExternalCard');
// } // }
} }
...@@ -342,6 +348,9 @@ export class BoxDialer { ...@@ -342,6 +348,9 @@ export class BoxDialer {
window.alovoice_setversion(packageJson?.version); window.alovoice_setversion(packageJson?.version);
} }
if (this.options) { if (this.options) {
if (typeof BX !== 'undefined')
BX?.localStorage?.remove('viExternalCard');
this.socket = new WebSocketInterface(`wss://${wsurl}/ws`); this.socket = new WebSocketInterface(`wss://${wsurl}/ws`);
this.callSession = false; this.callSession = false;
this.sipDomain = wsurl; this.sipDomain = wsurl;
......
...@@ -65,25 +65,22 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => { ...@@ -65,25 +65,22 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
'innerCallerModal', 'innerCallerModal',
); );
if ( if (boxDialer.isUaRunning) {
typeof BX !== 'undefined' &&
window.localStorage.getItem(BX.bitrix_sessid() + '_mycall') &&
window.localStorage.getItem('mycall')
) {
console.log('UA is running! in other tab'); console.log('UA is running! in other tab');
} else { } else {
if (typeof BX !== 'undefined')
BX?.localStorage?.remove('viExternalCard');
boxDialer.sipRegister(wsphonedata); boxDialer.sipRegister(wsphonedata);
} }
// setTimeout(function waitBxImPhoneTo() { setTimeout(
// if (BX && BX.IM) { (waitUaRegisterLost = () => {
// initBxImPhoneTo(); if (boxDialer.isUaRunning) {
// } else { setTimeout(waitUaRegisterLost, 10);
// setTimeout(waitBxImPhoneTo, 1); } else {
// } boxDialer.sipRegister(wsphonedata);
// }, 1); }
}),
10,
);
} }
}, []); }, []);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment