-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor 버전과 데이터 상태 분리 Refactor 커스텀 훅 이름 변경 Refactor 데이터, 버전 활용 분기점 설정 Fix 새로 고침할 때, 인증 상태 활용 Feat 버전 튜토리얼 Type 버전 상태 Style 나만의 공간 데이터 위치 조정 Refactor 불필요한 토스트 알림 방지
- Loading branch information
Showing
15 changed files
with
241 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useEffect } from "react"; | ||
|
||
import useModelStore from "../stores/useModelStore"; | ||
import useVersionStore from "../stores/useVersionStore"; | ||
|
||
const useNavigateVersion = (): null => { | ||
const { userVersion, versionIndex } = useVersionStore(); | ||
const { setModelPositions, setModelRotations } = useModelStore(); | ||
|
||
const hasUserVersion = userVersion.length > 0; | ||
const isCorrectIndex = versionIndex >= 0 && versionIndex < userVersion.length; | ||
|
||
useEffect(() => { | ||
if (hasUserVersion && isCorrectIndex) { | ||
const currentVersion = userVersion[versionIndex]; | ||
|
||
setModelPositions("firstSpeaker", currentVersion.firstSpeakerPosition); | ||
setModelPositions("secondSpeaker", currentVersion.secondSpeakerPosition); | ||
setModelPositions("listener", currentVersion.listenerPosition); | ||
setModelRotations("firstSpeaker", currentVersion.firstSpeakerRotation); | ||
setModelRotations("secondSpeaker", currentVersion.secondSpeakerRotation); | ||
setModelRotations("listener", currentVersion.listenerRotation); | ||
} | ||
}, [versionIndex, userVersion]); | ||
|
||
return null; | ||
}; | ||
|
||
export default useNavigateVersion; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.