From 680a5fad81b01fd413f1efdfda6bba233b1cd60d Mon Sep 17 00:00:00 2001 From: "lkh14011424@gmail.com" Date: Sat, 28 Sep 2024 11:38:56 +0900 Subject: [PATCH] =?UTF-8?q?[feat/#46]=20=EC=8A=A4=EB=83=85=EC=83=B7=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PoseDetector.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/PoseDetector.tsx b/src/components/PoseDetector.tsx index a304f70..4baf51a 100644 --- a/src/components/PoseDetector.tsx +++ b/src/components/PoseDetector.tsx @@ -149,11 +149,11 @@ const PoseDetector: React.FC = () => { const detect = useCallback( (results: pose[]): void => { + resultRef.current = results if (!isSnapShotSaved || !isInitialSnapShotExist || isModalOpen) { if (canvasRef.current) drawPose(results, canvasRef.current) return } - resultRef.current = results if (snapRef.current) { const _isShoulderTwist = detectSlope(snapRef.current, results, false) const _isTextNeck = detectTextNeck(snapRef.current, results, true, 0.88) @@ -299,12 +299,12 @@ const PoseDetector: React.FC = () => { }, []) useEffect(() => { - if (isPopupOpen) { + if (isPopupOpen && isInitialSnapShotExist) { openModal(modals.postureGuideModal, { onClose: () => [handleClosePopup()], }) } - }, [isPopupOpen]) + }, [isPopupOpen, isInitialSnapShotExist]) useEffect(() => { if (!isSnapShotSaved || !hasPermission) { @@ -373,7 +373,7 @@ const PoseDetector: React.FC = () => { {isModelLoaded && ( <> - {isInitialSnapShotExist && !isModalOpen && ( + {!isModalOpen && (