From 017b1590ab299e6fb56c8a8fdcb0699d298384d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?scnoh=28=EB=85=B8=EC=8A=B9=EC=B2=A0=29?= Date: Mon, 26 Sep 2022 16:32:56 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=EC=A0=95=EC=83=81=20=EC=83=81?= =?UTF-8?q?=ED=99=A9=20=EC=95=8C=EB=A6=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/map/naver/dron/DronToast.js | 37 ++++++++++------------ 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/components/map/naver/dron/DronToast.js b/src/components/map/naver/dron/DronToast.js index 1630b92c..bbfa6d44 100644 --- a/src/components/map/naver/dron/DronToast.js +++ b/src/components/map/naver/dron/DronToast.js @@ -10,51 +10,48 @@ import 'react-toastify/dist/ReactToastify.css'; const DronToast = () => { const dispatch = useDispatch(); - - const { controlGpList } = useSelector(state => state.controlGpState); + const { controlGpArcrftWarnList } = useSelector(state => state.controlGpLogState); const [toastId, setToastId] = useState(); useEffect(() => { - if (controlGpArcrftWarnList) { - // console.log("===================================") - // console.log('tastID : ', toastId); + if (controlGpArcrftWarnList) { if (!toastId) { - controlGpArcrftWarnList.forEach(warn => { - // console.log("Warn ==> ", gps.controlWarnCd); - // console.log("Noti ==> ", gps.controlWarnNotyCd); - if (warn.controlWarnCd) { - // console.log('warn CD : ', warn.controlWarnCd); - + + for (let i=0; i { - setToastId(null); - handleNotiClick(warn.controlId, warn.idntfNum); + onClick: () => { + handleNotiClick(controlGpArcrftWarnList[i].cntrlId, controlGpArcrftWarnList[i].idntfNum); + // setToastId(null); }, onClose: () => { setToastId(null); } } - ) + ); setToastId(id); - - return false; - } - }) + + break; + } + } } } }, [controlGpArcrftWarnList]); const handleNotiClick = (controlId, idntfNum) => { + console.log(controlId + ', ' + idntfNum); + dispatch(objectClickAction(controlId)); dispatch(controlGpDtlAction.request(controlId)); dispatch(controlGpFlightPlanAction.request(idntfNum));