Commit 41409feb authored by Muhammadali's avatar Muhammadali

update-

parent 1ae0733b
...@@ -23,7 +23,7 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => { ...@@ -23,7 +23,7 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => {
// const [callEvents, setCallEvents] = useState({}); // const [callEvents, setCallEvents] = useState({});
const [transferModel, setTransferModel] = useState(true); const [transferModel, setTransferModel] = useState(true);
const [numpadModal, setNumpadModal] = useState(false); const [numpadModal, setNumpadModal] = useState(false);
const [callEvents, setCallEvents] = useContext(contextModalEventProperty); const { callEvents, setCallEvents } = useContext(contextModalEventProperty);
// useEffect(() => { // useEffect(() => {
// boxDialer.setSipStateChangeCallback(setCallEvents, 'setCallEvents'); // boxDialer.setSipStateChangeCallback(setCallEvents, 'setCallEvents');
// }, []); // }, []);
......
/** @format */ /** @format */
import React, { createContext } from 'react'; import React, { createContext, useState } from 'react';
import { useState } from 'react';
export const contextModalEventProperty = createContext(null); export const contextModalEventProperty = createContext(null);
const ModalEventProperty = ({ children }) => { const ModalEventProperty = ({ children }) => {
const [callEvents, setCallEvents] = useState({}); const [callEvents, setCallEvents] = useState({});
return ( return (
<contextModalEventProperty.Provider value={[callEvents, setCallEvents]}> <contextModalEventProperty.Provider value={{ callEvents, setCallEvents }}>
{children} {children}
</contextModalEventProperty.Provider> </contextModalEventProperty.Provider>
); );
......
...@@ -13,7 +13,7 @@ import { contextModalEventProperty } from '../context/modalEventProperty'; ...@@ -13,7 +13,7 @@ import { contextModalEventProperty } from '../context/modalEventProperty';
const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => { const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
const boxDialer = window.BoxDialer; const boxDialer = window.BoxDialer;
const [callEvents, setCallEvents] = useContext(contextModalEventProperty); const { callEvents, setCallEvents } = useContext(contextModalEventProperty);
const [phoneModal, setPhoneModal] = useState(false); const [phoneModal, setPhoneModal] = useState(false);
const [dynamicValue, setDynamicValue] = useState('pending'); const [dynamicValue, setDynamicValue] = useState('pending');
const [modalState, setModalState] = useState(false); const [modalState, setModalState] = useState(false);
......
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