Commit bf4c5e45 authored by Muhammadali's avatar Muhammadali

update-

parent 1d3e98cd
{
"name": "boxdialer",
"version": "4.6.5",
"version": "4.6.6",
"description": "",
"main": "src/boxDialer.js",
"scripts": {
......
......@@ -240,6 +240,14 @@ export class BoxDialer {
};
}
isUaRunning() {
return (
typeof BX !== 'undefined' &&
window.localStorage.getItem(BX.bitrix_sessid() + '_mycall') &&
window.localStorage.getItem('mycall')
);
}
removeViExternalCard() {
// if (
// typeof BX !== 'undefined' &&
......@@ -247,10 +255,8 @@ export class BoxDialer {
// window.localStorage.getItem('mycall')
// ) {
// BX?.localStorage?.remove('viExternalCard');
// } else if (typeof BX !== 'undefined') {
// BX?.localStorage?.remove('viExternalCard');
// }
}
......@@ -342,6 +348,9 @@ export class BoxDialer {
window.alovoice_setversion(packageJson?.version);
}
if (this.options) {
if (typeof BX !== 'undefined')
BX?.localStorage?.remove('viExternalCard');
this.socket = new WebSocketInterface(`wss://${wsurl}/ws`);
this.callSession = false;
this.sipDomain = wsurl;
......
......@@ -65,25 +65,22 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
'innerCallerModal',
);
if (
typeof BX !== 'undefined' &&
window.localStorage.getItem(BX.bitrix_sessid() + '_mycall') &&
window.localStorage.getItem('mycall')
) {
if (boxDialer.isUaRunning) {
console.log('UA is running! in other tab');
} else {
if (typeof BX !== 'undefined')
BX?.localStorage?.remove('viExternalCard');
boxDialer.sipRegister(wsphonedata);
}
// setTimeout(function waitBxImPhoneTo() {
// if (BX && BX.IM) {
// initBxImPhoneTo();
// } else {
// setTimeout(waitBxImPhoneTo, 1);
// }
// }, 1);
setTimeout(
(waitUaRegisterLost = () => {
if (boxDialer.isUaRunning) {
setTimeout(waitUaRegisterLost, 10);
} else {
boxDialer.sipRegister(wsphonedata);
}
}),
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