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,42 +92,35 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -100,42 +92,35 @@ 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} widjetVersion={packageJson?.version}
widjetVersion={packageJson?.version} leftTime={wsphonedata.lefttime}
leftTime={wsphonedata.lefttime} position={wsphonedata.position || 'bottomLeft'}
position={wsphonedata.position || 'bottomLeft'} 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} widjetVersion={packageJson?.version}
widjetVersion={packageJson?.version} leftTime={wsphonedata.lefttime}
leftTime={wsphonedata.lefttime} position={wsphonedata.position || 'bottomLeft'}
position={wsphonedata.position || 'bottomLeft'} 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,63 +129,54 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => { ...@@ -144,63 +129,54 @@ 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} variant={wsphonedata.variant || 'defaultWidjet'}
variant={wsphonedata.variant || 'defaultWidjet'} position={wsphonedata.position || 'bottomLeft'}
position={wsphonedata.position || 'bottomLeft'} />
/>
<ModalPhoneNumpad
<ModalPhoneNumpad setSettingHidden={setSettingHidden}
setSettingHidden={setSettingHidden} settingHidden={settingHidden}
settingHidden={settingHidden} modalState={modalState}
modalState={modalState} phoneModal={phoneModal}
phoneModal={phoneModal} reasons={wsphonedata?.reasons}
reasons={wsphonedata?.reasons} reason={wsphonedata?.reason}
reason={wsphonedata?.reason} onClick={(e) => e.stopPropagation()}
onClick={(e) => e.stopPropagation()} dynamicValue={dynamicValue}
dynamicValue={dynamicValue} onSetDnd={reasonSelect}
onSetDnd={reasonSelect} variant={wsphonedata.variant || 'defaultWidjet'}
variant={wsphonedata.variant || 'defaultWidjet'} position={wsphonedata.position || 'bottomLeft'}
position={wsphonedata.position || 'bottomLeft'} extnums={wsphonedata.extnums}
extnums={wsphonedata.extnums} />
/>
<Modal
<Modal className='tailwindGlobalCss'
className='tailwindGlobalCss' hidden={modalState.bool}
hidden={modalState.bool} callType={modalState.callType}
callType={modalState.callType} // hidden={true}
// hidden={true} // callType={'incoming'}
// callType={'incoming'} hangupButton={hangupButton}
hangupButton={hangupButton} phoneNumber={modalState.callType === 'outcoming' ? 'inputValue' : modalState.callFromName}
phoneNumber={ />
modalState.callType === 'outcoming'
? 'inputValue' <InnerCaller
: modalState.callFromName hidden={innerCallerModal.bool}
} type={innerCallerModal.type}
/> from={innerCallerModal.from}
innerTimer={innerTimer}
<InnerCaller />
hidden={innerCallerModal.bool}
type={innerCallerModal.type} <SecondNotifSip secondLine={secondLine}/>
from={innerCallerModal.from} </>);
innerTimer={innerTimer}
/>
<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