Commit 9c820833 authored by Muhammadali's avatar Muhammadali

update

parent 26ebe526
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "2.0.0", "version": "2.0.1",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
...@@ -6,6 +6,7 @@ import { Toaster } from 'react-hot-toast'; ...@@ -6,6 +6,7 @@ import { Toaster } from 'react-hot-toast';
import { BoxDialer } from './lib/boxDIaler'; import { BoxDialer } from './lib/boxDIaler';
import Root from './root'; import Root from './root';
import './index.css'; import './index.css';
import ControlRenderBX from './lib/controlRenderBX';
window.BoxDialer = new BoxDialer(); window.BoxDialer = new BoxDialer();
const container = document.getElementById('boxdialerwidjet'); const container = document.getElementById('boxdialerwidjet');
...@@ -14,6 +15,8 @@ const root = createRoot(container); ...@@ -14,6 +15,8 @@ const root = createRoot(container);
root.render( root.render(
<React.StrictMode> <React.StrictMode>
<Toaster /> <Toaster />
<Root /> {/* {controlRenderBX({ rootComponent: <Root /> })} */}
{/* <Root /> */}
<ControlRenderBX rootComponent={<Root />} />
</React.StrictMode>, </React.StrictMode>,
); );
/** @format */
import React, { useEffect, useState } from 'react';
const ControlRenderBX = ({ rootComponent }) => {
const [data, setData] = useState({});
// const intervalFetchToBx = null;
// window.alovoice_wsphone;
useEffect(() => {
var intervalFetchToBx = setInterval(intervalFunc, 1000);
}, []);
const intervalFunc = () => {
console.log('interval', window.alovoice_wsphone);
if (Boolean(data.number)) {
clearInterval(intervalFetchToBx);
}
};
console.log('check_data', Boolean(data.number));
return rootComponent;
};
export default ControlRenderBX;
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