Skip to content

Commit

Permalink
Merge pull request #362 from ffalswo2/fix/#361-출석-무한로딩
Browse files Browse the repository at this point in the history
  • Loading branch information
ffalswo2 authored Apr 5, 2024
2 parents 5c21b8e + ac39db2 commit fe26ae5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct AttendanceRoundModel {
public struct AttendanceRoundModel: Equatable {
public let subLectureId: Int
public let round: Int

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ 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 @@ -133,6 +133,12 @@ extension ShowAttendanceViewModel {
.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)
output.attendanceButtonInfo.send(buttonInfo)
return
}
owner.lectureRound = lectureRound
let buttonInfo = AttendanceButtonInfo(title: I18N.Attendance.takeNthAttendance(lectureRound.round), isEnalbed: true)
output.attendanceButtonInfo.send(buttonInfo)
Expand Down

0 comments on commit fe26ae5

Please sign in to comment.