Commit 0b1fad65 authored by krysent's avatar krysent

timeout

parent e3673625
...@@ -22,10 +22,11 @@ import { message } from "antd"; ...@@ -22,10 +22,11 @@ import { message } from "antd";
const { NODE_ENV } = process.env; const { NODE_ENV } = process.env;
const websocketUrl = const websocketUrl =
NODE_ENV == "development" NODE_ENV == "development"
? "http://192.168.40.41:7001" : 'http://192.168.40.41:7001' ? "http://192.168.40.41:7001"
// : `${window.location.protocol == "http:" ? "ws" : "wss"}://${ : "http://192.168.40.41:7001";
// window.location.host // : `${window.location.protocol == "http:" ? "ws" : "wss"}://${
// }`; // window.location.host
// }`;
let socket; let socket;
export default (second) => { export default (second) => {
const ref = useRef(null); const ref = useRef(null);
...@@ -63,7 +64,6 @@ export default (second) => { ...@@ -63,7 +64,6 @@ export default (second) => {
console.log("socketIO", data); console.log("socketIO", data);
setsocketType(data?.wsMsgModel); setsocketType(data?.wsMsgModel);
}); });
}, []); }, []);
useAsyncEffect(() => { useAsyncEffect(() => {
if (!isFullscreen) { if (!isFullscreen) {
...@@ -169,6 +169,7 @@ export default (second) => { ...@@ -169,6 +169,7 @@ export default (second) => {
}); });
useEffect(() => { useEffect(() => {
setTimeout(() => {
switch (socketType) { switch (socketType) {
case "INDEX_BOARD_INSTORE": case "INDEX_BOARD_INSTORE":
InstoreDataFetch.run(); InstoreDataFetch.run();
...@@ -197,6 +198,7 @@ export default (second) => { ...@@ -197,6 +198,7 @@ export default (second) => {
default: default:
return; return;
} }
}, 1000);
}, [socketType]); }, [socketType]);
return ( return (
......
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