Fix: 모바일 자체 뒤로가기 제어 로직#44
Conversation
- useRunModals 훅에서 뒤로가기 및 종료 시 공통으로 사용되는 로직을 cleanupAndGoBack 함수로 통합 - Run 페이지에서 하드웨어 뒤로가기 버튼 제어 추가 - useFocusEffect를 통해 위치 추적 및 상태 초기화 로직을 유지
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Summary of Changes
Hello @Monixc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
이 PR은 모바일 환경에서 앱의 뒤로가기 및 종료 동작을 보다 일관되고 효율적으로 관리하기 위한 개선 사항을 포함합니다. 중복되는 정리 로직을 단일 함수로 통합하고, 안드로이드 기기의 하드웨어 뒤로가기 버튼에 대한 명시적인 제어를 추가하여 사용자 경험을 향상시키고 코드 유지보수성을 높였습니다.
Highlights
- 뒤로가기 로직 통합: useRunModals 훅 내에서 위치 추적 초기화, 상태 초기화, courseId 파라미터 초기화 및 뒤로가기 기능을 포함하는 cleanupAndGoBack 함수를 새로 생성하여, 뒤로가기 확인, 종료 확인, 기록 저장 성공 시의 공통 로직을 통합했습니다.
- 모바일 하드웨어 뒤로가기 버튼 제어: Run 페이지에 BackHandler를 사용하여 안드로이드 하드웨어 뒤로가기 버튼을 제어하는 로직을 추가했습니다. 이제 하드웨어 뒤로가기 버튼을 누르면 handleBackPress 함수가 호출됩니다.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
| resetLocationTracking(); | ||
| resetRunState(); |
There was a problem hiding this comment.
resetLocationTracking()과 resetRunState()를 연달아 호출하고 있습니다. run.store.ts를 보면 resetRunState가 initialLocationTrackingState를 포함한 전체 상태를 초기화하고, resetLocationTracking은 위치 추적 관련 상태를 초기화하고 구독을 해제합니다. 이로 인해 일부 상태(e.g., routeCoordinates, isTracking)가 중복으로 초기화되고 있습니다.
resetLocationTracking은 구독 해제만 담당하도록 하고, 상태 초기화는 resetRunState에서만 담당하도록 역할을 분리하면 코드가 더 명확해지고 중복을 제거할 수 있을 것 같습니다. 이는 run.store.ts 파일의 수정이 필요할 수 있는 제안입니다.
| resetLocationTracking(); | ||
| resetRunState(); |
There was a problem hiding this comment.
작업 내용
참고 사항