Commit 3ff88cbd authored by Muhammadali's avatar Muhammadali

update-

parent 48cc5124
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "4.7.7", "version": "4.7.8",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
...@@ -13,14 +13,6 @@ window.BoxDialer = new BoxDialer(); ...@@ -13,14 +13,6 @@ window.BoxDialer = new BoxDialer();
const container = document.getElementById('boxdialerwidjet'); const container = document.getElementById('boxdialerwidjet');
const root = createRoot(container); const root = createRoot(container);
window.onbeforeunload = () => {
if (typeof BX !== 'undefined') {
console.log('window_onbeforeunload =============-------------');
localStorage.removeItem('mycall');
localStorage.removeItem(BX.bitrix_sessid() + '_mycall');
}
};
root.render( root.render(
<React.StrictMode> <React.StrictMode>
<LanguageController> <LanguageController>
......
...@@ -155,6 +155,15 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => { ...@@ -155,6 +155,15 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
wsphonedata, wsphonedata,
); );
window.onbeforeunload = () => {
if (typeof BX !== 'undefined') {
console.log('window_onbeforeunload =============-------------');
localStorage.removeItem('mycall');
localStorage.removeItem(BX.bitrix_sessid() + '_mycall');
alert('blablabla closing');
}
};
if (!wsphonedata || !wsphonedata?.number || !wsphonedata?.position) return; if (!wsphonedata || !wsphonedata?.number || !wsphonedata?.position) return;
return ( return (
<> <>
......
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