-
Notifications
You must be signed in to change notification settings - Fork 1
[Fix] 홈 화면에서의 루틴 등록 및 완료 관련 버그 수정 #87
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,19 +146,6 @@ final class RoutineCreationViewController: BaseViewController<RoutineCreationVie | |
| UIAction { [weak self] _ in | ||
| guard let self else { return } | ||
| self.viewModel.action(input: .registerRoutine) | ||
| if self.isFromMypage { | ||
| if | ||
| let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, | ||
| let window = windowScene.windows.first(where: { $0.isKeyWindow }), | ||
| let tabBarView = window.rootViewController as? TabBarView { | ||
| self.navigationController?.popToRootViewController(animated: false) | ||
| tabBarView.selectedIndex = 1 | ||
| viewModel.action(input: .showRecommendedRoutineToastMessageView) | ||
| } | ||
| } else { | ||
| viewModel.action(input: .showUpdateRoutineToastMessageView) | ||
| self.navigationController?.popViewController(animated: true) | ||
| } | ||
| }, | ||
| for: .touchUpInside) | ||
| bindCreationCardViews() | ||
|
|
@@ -314,6 +301,28 @@ final class RoutineCreationViewController: BaseViewController<RoutineCreationVie | |
| } | ||
| } | ||
| .store(in: &cancellables) | ||
|
|
||
| viewModel.output.routineCreationResultPublisher | ||
| .receive(on: DispatchQueue.main) | ||
| .sink { [weak self] creationResult in | ||
| guard let self else { return } | ||
| if creationResult { | ||
| if self.isFromMypage { | ||
| if | ||
| let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, | ||
| let window = windowScene.windows.first(where: { $0.isKeyWindow }), | ||
| let tabBarView = window.rootViewController as? TabBarView { | ||
| self.navigationController?.popToRootViewController(animated: false) | ||
| tabBarView.selectedIndex = 1 | ||
| viewModel.action(input: .showRecommendedRoutineToastMessageView) | ||
| } | ||
| } else { | ||
| viewModel.action(input: .showUpdateRoutineToastMessageView) | ||
| self.navigationController?.popViewController(animated: true) | ||
| } | ||
|
Comment on lines
+319
to
+322
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Search for showUpdatedRoutineToast usage and related message display
rg -n "showUpdatedRoutineToast" --type swift -A 5Repository: YAPP-Github/Bitnagil-iOS Length of output: 2898 🏁 Script executed: # Search for Korean text related to routine update/creation toast message
rg -n "수정|생성|등록" --type swift | grep -i toastRepository: YAPP-Github/Bitnagil-iOS Length of output: 212 🏁 Script executed: # Search for ToastMessage or toast-related views
rg -n "ToastMessage|ToastView" --type swiftRepository: YAPP-Github/Bitnagil-iOS Length of output: 4523 🏁 Script executed: # Check RoutineCreationViewController to see if there's different handling for new vs update
cat -n Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift | sed -n '305,330p'Repository: YAPP-Github/Bitnagil-iOS Length of output: 1546 🏁 Script executed: # Check if there's a separate toast message for routine creation (vs update)
rg -n "루틴.*등록|루틴.*생성|routine.*creat" --type swift -i | head -20Repository: YAPP-Github/Bitnagil-iOS Length of output: 3256 루틴 신규 생성 시 토스트 메시지가 "수정" 관련 문구로 표시되는 문제
신규 생성과 수정을 구분하여 각각 적절한 토스트 메시지("루틴 생성이 완료되었습니다." vs "루틴 수정이 완료되었습니다.")를 표시하도록 수정이 필요합니다. 🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
| .store(in: &cancellables) | ||
| } | ||
|
|
||
| private func bindCreationCardViews() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네트워크 오류 시
refreshControl이 종료되지 않아 스피너가 무한히 표시됨endRefreshing()이routinesPublisher구독 내에서만 호출됩니다.refreshDailyRoutine액션이 네트워크 오류로 실패하면:networkErrorPublisher로 에러 알럿이 표시됨routinesPublisher는 방출되지 않음endRefreshing()이 호출되지 않아 리프레시 스피너가 무한히 계속 돌아감networkErrorPublisher를 처리하는 경로에서도endRefreshing()을 호출해야 합니다.🐛 수정 방향 제안
bind()내에서networkErrorPublisher에 추가 구독을 연결하거나,bindNetworkError호출 전에 별도 처리:또는
bindNetworkError구현 내부에서 콜백으로 처리하는 방식도 가능합니다.📝 Committable suggestion
🤖 Prompt for AI Agents