feat: api 호출 실패 시 화면 처리 #354
Merged
Merged
Conversation
added 14 commits
June 4, 2026 19:16
- emptyView y축 가운데 정렬 - 첫 목표 이후 화살표 제거
Member
|
@coderabbitai summary |
clxxrlove
reviewed
Jun 10, 2026
Comment on lines
-344
to
+352
| case .response(.fetchGoalsFailed): | ||
| case let .response(.fetchGoalsFailed(date)): | ||
| guard date == state.calendarDate else { return .none } | ||
| state.isLoading = false | ||
| return .send(.presentation(.showToast(.warning(message: "목표 조회에 실패했어요")))) | ||
| state.isFetchFailed = true | ||
| return .none |
Member
There was a problem hiding this comment.
여기는 조금 어려운데, 캐시 데이터가 있는 경우에도 refresh가 실패하면 state.isFetchFailed가 true가 되어서
로딩 인디케이터가 화면을 꽉 덮을 거 같은데 어떻게 해결해야 할 지 잘 모르겠네... 토스트를 띄우면 되려나?
Contributor
Author
There was a problem hiding this comment.
그러게 지금 txDataRetry 구조가 overlay로 띄우는거라 캐시된 데이터랑 재시도뷰가 겹처 보이네
그래서 overlay로 덮는 구조로 안하고 재시도가 필요한 상황일 때 기존 콘텐츠가 아닌 DataRetryView 보여주면 안겹치게 할 수 있을 거 같은데 어떻게 생각해?
as-is
.txDataRetry(
isPresented: store.isFetchFailed,
onRetry: { store.send(.view(.dataRetryTapped)) }
)
to-be
if store.isFetchFailed {
DataRetryView {
store.send(.view(.dataRetryTapped))
}
} else if store.hasCards {
HomeContentSection(store: store)
} else if store.isEmptyVisible {
HomeEmptyContentSection(store: store)
}
Member
There was a problem hiding this comment.
맞아 overlay로 하면 화면이 겹쳐서 어색할 거 같다
to-be 방향으로 필요에 따라 DataRetryView를 보여주는 게 더 좋은 거 같아 !!
반영하고 머지하자 !!
Comment on lines
+131
to
+135
| case let .response(.fetchStatsFailed(month, isOngoing)): | ||
| guard month == state.currentMonth.formattedYearDashMonth, | ||
| isOngoing == state.isOngoing else { | ||
| return .none | ||
| } |
Member
There was a problem hiding this comment.
여기 실패 케이스에서 isOngoing 받는 부분은 좋은데,
성공 부분은 제대로 안 맞추고 있는거 같아. 거기에서도 `case fetchStats(..., isOngoing: Bool)로 맞추는게 어때?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 관련 이슈
📙 작업 내역
🎨 스크린샷 또는 시연 영상 (선택)
테스트용 화면
