Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat/#46] 스냅샷 저장 로직 수정 #109

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading