Commit cdadc284 authored by Muhammadali's avatar Muhammadali

update

parent b03872f4
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "2.0.9", "version": "2.1.0",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
...@@ -8,7 +8,7 @@ import Modal from '../components/Modal'; ...@@ -8,7 +8,7 @@ import Modal from '../components/Modal';
import BxMiniWidjetUi from '../components/BxMiniWidjetUi'; import BxMiniWidjetUi from '../components/BxMiniWidjetUi';
import SecondNotifSip from '../components/SecondNotifSip'; import SecondNotifSip from '../components/SecondNotifSip';
const Root = ({ data, onSetDnd }) => { const Root = ({ data, onSetDnd, setData }) => {
// const [dataSecond, setDataSecond] = useState([]); // const [dataSecond, setDataSecond] = useState([]);
// if (!data) { // if (!data) {
// data = { // data = {
...@@ -26,7 +26,7 @@ const Root = ({ data, onSetDnd }) => { ...@@ -26,7 +26,7 @@ const Root = ({ data, onSetDnd }) => {
// } // }
if (window?.alovoice_wsphone) { if (window?.alovoice_wsphone) {
// data = window.alovoice_wsphone; data = window.alovoice_wsphone;
onSetDnd = window.alovoice_onsetdnd; onSetDnd = window.alovoice_onsetdnd;
} }
...@@ -53,20 +53,18 @@ const Root = ({ data, onSetDnd }) => { ...@@ -53,20 +53,18 @@ const Root = ({ data, onSetDnd }) => {
boxDialer.setSipStateChangeCallback(setSecondLine, 'secondLine'); boxDialer.setSipStateChangeCallback(setSecondLine, 'secondLine');
boxDialer.sipRegister(data); boxDialer.sipRegister(data);
} }
onSetDnd(data); setData(data);
}, []); }, []);
const hangupButton = () => { const hangupButton = () => {
boxDialer.hangupButtonClick(); boxDialer.hangupButtonClick();
}; };
window.setWSData = (result) => { window.setWSData = (result) => {
onSetDnd(result); setData(result);
}; };
const reasonSelect = async (e) => { const reasonSelect = async (e) => {
console.log('reasonSelect', e);
let result = await onSetDnd(e); let result = await onSetDnd(e);
console.log('result', result); setData(result);
onSetDnd(result);
// data = result; // data = result;
}; };
const selectWidjetType = (type) => { const selectWidjetType = (type) => {
...@@ -103,7 +101,7 @@ const Root = ({ data, onSetDnd }) => { ...@@ -103,7 +101,7 @@ const Root = ({ data, onSetDnd }) => {
}; };
if (!data || !data?.number || !data?.position) return; if (!data || !data?.number || !data?.position) return;
console.log(data, 'data'); console.log(modalState, 'modalState');
return ( return (
<> <>
{selectWidjetType(data.variant)} {selectWidjetType(data.variant)}
......
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