Commit 54e0e39e authored by Muhammadali's avatar Muhammadali

update

parent cbf3fa28
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "4.8.73", "version": "4.8.74",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
...@@ -25,9 +25,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -25,9 +25,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
// const [secondLine, setSecondLine] = useState(false); // const [secondLine, setSecondLine] = useState(false);
const [innerTimer, setInnerTimer] = useState(null); const [innerTimer, setInnerTimer] = useState(null);
const [innerCallerModal, setInnerCallerModal] = useState({ const [innerCallerModal, setInnerCallerModal] = useState({
bool: false, bool: false, type: null, from: '',
type: null,
from: '',
}); });
useEffect(() => { useEffect(() => {
...@@ -38,7 +36,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -38,7 +36,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
} }
}, [secondLine]); }, [secondLine]);
useEffect(()=> { useEffect(() => {
boxDialer.setGlobalHistoryData(useColorConfigStore.state) boxDialer.setGlobalHistoryData(useColorConfigStore.state)
}, [useColorConfigStore.state]) }, [useColorConfigStore.state])
...@@ -50,18 +48,12 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -50,18 +48,12 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
boxDialer.setSipStateChangeCallback(setPhoneModal, 'phoneModal'); boxDialer.setSipStateChangeCallback(setPhoneModal, 'phoneModal');
boxDialer.setSipStateChangeCallback(setInnerTimer, 'innerTimer'); boxDialer.setSipStateChangeCallback(setInnerTimer, 'innerTimer');
boxDialer.setSipStateChangeCallback(configHoldMute.setState, 'setCallEvents'); boxDialer.setSipStateChangeCallback(configHoldMute.setState, 'setCallEvents');
boxDialer.setSipStateChangeCallback( boxDialer.setSipStateChangeCallback(setInnerCallerModal, 'innerCallerModal',);
setInnerCallerModal,
'innerCallerModal',
);
if (boxDialer.isUaRunning()) console.log('UA is running! in other tab'); if (boxDialer.isUaRunning()) console.log('UA is running! in other tab'); else boxDialer.sipRegister(wsphonedata);
else boxDialer.sipRegister(wsphonedata);
setTimeout(function waitUaRegisterLost() { setTimeout(function waitUaRegisterLost() {
if (boxDialer.isUaRunning() || boxDialer.isRestarting) if (boxDialer.isUaRunning() || boxDialer.isRestarting) setTimeout(waitUaRegisterLost, 10); else boxDialer.sipRegister(wsphonedata);
setTimeout(waitUaRegisterLost, 10);
else boxDialer.sipRegister(wsphonedata);
}, 10); }, 10);
} }
}, []); }, []);
...@@ -100,8 +92,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -100,8 +92,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
const selectWidjetType = (type) => { const selectWidjetType = (type) => {
switch (type) { switch (type) {
case 'bxmini': case 'bxmini':
return ( return (<BxMiniWidjetUi
<BxMiniWidjetUi
widjetState={dynamicValue} widjetState={dynamicValue}
phoneNumber={wsphonedata?.number} phoneNumber={wsphonedata?.number}
reason={wsphonedata?.reason} reason={wsphonedata?.reason}
...@@ -111,11 +102,9 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -111,11 +102,9 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
onClick={() => { onClick={() => {
phoneModal ? setPhoneModal(false) : setPhoneModal(true); phoneModal ? setPhoneModal(false) : setPhoneModal(true);
}} }}
/> />);
);
default: default:
return ( return (<DefaultWidjetUi
<DefaultWidjetUi
widjetState={dynamicValue} widjetState={dynamicValue}
phoneNumber={wsphonedata?.number} phoneNumber={wsphonedata?.number}
reason={wsphonedata?.reason} reason={wsphonedata?.reason}
...@@ -125,17 +114,13 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -125,17 +114,13 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
onClick={() => { onClick={() => {
phoneModal ? setPhoneModal(false) : setPhoneModal(true); phoneModal ? setPhoneModal(false) : setPhoneModal(true);
}} }}
/> />);
);
} }
}; };
console.log( console.log('wsphonedata_all_data: ', wsphonedata?.position, wsphonedata?.number, wsphonedata,);
'wsphonedata_all_data: ',
wsphonedata?.position, console.log('modalState_callType: ', modalState.callType)
wsphonedata?.number,
wsphonedata,
);
window.onbeforeunload = () => { window.onbeforeunload = () => {
if (typeof BX !== 'undefined') { if (typeof BX !== 'undefined') {
...@@ -144,17 +129,13 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -144,17 +129,13 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
localStorage.removeItem('mycall'); localStorage.removeItem('mycall');
localStorage.removeItem(BX.bitrix_sessid() + '_mycall'); localStorage.removeItem(BX.bitrix_sessid() + '_mycall');
console.log( console.log('--==== Checking removed Items: ', localStorage.getItem('mycall'), localStorage.getItem(BX.bitrix_sessid() + '_mycall'),);
'--==== Checking removed Items: ',
localStorage.getItem('mycall'),
localStorage.getItem(BX.bitrix_sessid() + '_mycall'),
);
} }
}; };
if (!wsphonedata?.number && !wsphonedata?.position) return; if (!wsphonedata?.number && !wsphonedata?.position) return;
return ( return (<>
<>
{selectWidjetType(wsphonedata.variant)} {selectWidjetType(wsphonedata.variant)}
<SettingComponent <SettingComponent
settingHidden={settingHidden && phoneModal ? true : false} settingHidden={settingHidden && phoneModal ? true : false}
...@@ -184,11 +165,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -184,11 +165,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
// hidden={true} // hidden={true}
// callType={'incoming'} // callType={'incoming'}
hangupButton={hangupButton} hangupButton={hangupButton}
phoneNumber={ phoneNumber={modalState.callType === 'outcoming' ? 'inputValue' : modalState.callFromName}
modalState.callType === 'outcoming'
? 'inputValue'
: modalState.callFromName
}
/> />
<InnerCaller <InnerCaller
...@@ -199,8 +176,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -199,8 +176,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
/> />
<SecondNotifSip secondLine={secondLine}/> <SecondNotifSip secondLine={secondLine}/>
</> </>);
);
}; };
export default Root; export default Root;
......
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