Skip to content

Commit

Permalink
[iOS] fix ios unintended timetable switching when favoriting a session
Browse files Browse the repository at this point in the history
  • Loading branch information
gokuma committed Sep 11, 2024
1 parent 4862d8a commit 63ba4a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"sourceLanguage" : "en",
"strings" : {
"%lld" : {

},
"Contributor" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -51,4 +54,4 @@
}
},
"version" : "1.0"
}
}
23 changes: 13 additions & 10 deletions app-ios/Sources/TimetableFeature/TimetableReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,21 @@ public struct TimetableReducer : Sendable{
}

case let .requestDay(dayTab):
return .run { send in
for try await timetables in try timetableClient.streamTimetable() {
let internalDay: DroidKaigi2024Day = switch dayTab {
case DayTab.day1:
DroidKaigi2024Day.conferenceDay1
case DayTab.day2:
DroidKaigi2024Day.conferenceDay2
return .concatenate(
.cancel(id: CancelID.connection),
.run { send in
for try await timetables in try timetableClient.streamTimetable() {
let internalDay: DroidKaigi2024Day = switch dayTab {
case DayTab.day1:
DroidKaigi2024Day.conferenceDay1
case DayTab.day2:
DroidKaigi2024Day.conferenceDay2
}
await send(.response(.success(timetables.dayTimetable(droidKaigi2024Day: internalDay).contents)))
}
await send(.response(.success(timetables.dayTimetable(droidKaigi2024Day: internalDay).contents)))
}
}
.cancellable(id: CancelID.connection)
.cancellable(id: CancelID.connection)
)

case .response(.success(let timetables)):
state.timetableItems = sortListIntoTimeGroups(timetableItems: timetables)
Expand Down

0 comments on commit 63ba4a3

Please sign in to comment.