Commit 54e0e39e authored by Muhammadali's avatar Muhammadali

update

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