diff --git a/Projects/App/Sources/Main/MainViewModel.swift b/Projects/App/Sources/Main/MainViewModel.swift index 4df5049..dcdb9ff 100644 --- a/Projects/App/Sources/Main/MainViewModel.swift +++ b/Projects/App/Sources/Main/MainViewModel.swift @@ -191,7 +191,10 @@ extension MainViewModel { }) .disposed(by: disposeBag) + // 마감 시간이 지나고 바로 리스트 재요청 시 그대로 남아있는 이슈가 있음 + // 따라서 delay 400ms를 추가함 mainDataSource.didDeadLineCountdownTimeOver + .delay(.milliseconds(400), scheduler: MainScheduler.instance) .subscribe(onNext: { [weak self] in self?.reload() }) diff --git a/Projects/App/Sources/Usecase/GifticonEntity.swift b/Projects/App/Sources/Usecase/GifticonEntity.swift index 0cbd904..9d349da 100644 --- a/Projects/App/Sources/Usecase/GifticonEntity.swift +++ b/Projects/App/Sources/Usecase/GifticonEntity.swift @@ -13,7 +13,9 @@ struct GifticonEntity { init(_ responseModel: [GifticonResponseModel] = []) { gifticonList = responseModel.compactMap({ model in - GifticonCard( + // 마감 시간이 지난 경우 리스트에 노출되지 않도록 방어 + guard model.sprinkleAt.fullStringDate().compare(Date()) != .orderedAscending else { return nil } + return GifticonCard( sprinkleTime: model.sprinkleAt, gifticonInfo: Gifticon( id: model.sprinkleID, @@ -22,7 +24,8 @@ struct GifticonEntity { expirationDate: model.expiredAt, category: Category(rawValue: model.category) ?? .all), numberOfParticipants: model.participants, - isParticipating: model.participateIn) + isParticipating: model.participateIn + ) }) } }