Skip to content

Commit

Permalink
Merge pull request #109 from DDD-Community/feat/#46
Browse files Browse the repository at this point in the history
[feat/#46] 스냅샷 저장 로직 수정
  • Loading branch information
lkhoony authored Sep 28, 2024
2 parents bd129a0 + 680a5fa commit 4ba3953
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/PoseDetector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -373,7 +373,7 @@ const PoseDetector: React.FC = () => {
<Camera detectStart={detectStart} canvasRef={canvasRef} />
{isModelLoaded && (
<>
{isInitialSnapShotExist && !isModalOpen && (
{!isModalOpen && (
<PostureMessage
isSnapShotSaved={isSnapShotSaved}
isShoulderTwist={isShoulderTwist}
Expand Down

0 comments on commit 4ba3953

Please sign in to comment.