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

[Fix] #363 - 무한로딩 해결 로직 수정 #364

Merged
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension ShowAttendanceRepository: ShowAttendanceRepositoryInterface {
public func fetchLectureRound(lectureId: Int) -> AnyPublisher<AttendanceRoundModel?, Error> {
return self.attendanceService
.fetchAttendanceRound(lectureId: lectureId)
.compactMap { $0.data?.toDomain() }
.map { $0.data?.toDomain() }
.eraseToAnyPublisher()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ extension DefaultShowAttendanceUseCase: ShowAttendanceUseCase {
})
.sink(receiveCompletion: { event in
print("completion: fetchLectureRound \(event)")
self.lectureRound.send(.EMPTY)
}, receiveValue: { result in
/// 출석 진행중인데 이미 출석 완료한 경우
if self.takenAttendance.rawValue == result?.round {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,12 @@ extension ShowAttendanceViewModel {
.store(in: self.cancelBag)

lectureRound
.compactMap { $0 }
.withUnretained(self)
.sink { owner, lectureRound in
if lectureRound == .EMPTY {
output.isLoading.send(false)
let buttonInfo = AttendanceButtonInfo(title: I18N.Attendance.takeNthAttendance(2), isEnalbed: false)
guard let lectureRound else {
let buttonInfo = AttendanceButtonInfo(title: I18N.Attendance.takeNthAttendance(1), isEnalbed: false)
output.attendanceButtonInfo.send(buttonInfo)
output.isLoading.send(false)
return
}
owner.lectureRound = lectureRound
Expand Down