Skip to content

Commit

Permalink
🔧 Remove duplicate elements from the language selection on the search…
Browse files Browse the repository at this point in the history
… screen.
  • Loading branch information
Corvus400 committed Sep 12, 2023
1 parent f5e04b0 commit 8e24f55
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ final class SearchViewModel: ObservableObject {
return
}
let timetableContents = cachedTimetable.filtered(filters: state.filters).contents
let uniqueLanguages = {
var set: Set<String> = []
return cachedTimetable.languages.filter { set.insert($0.langOfSpeaker).inserted }
}()
let timetableTimeGroupItems = timetableContents
.map { content in
let items = timetableContents
Expand All @@ -90,7 +94,7 @@ final class SearchViewModel: ObservableObject {
categories: cachedTimetable.categories,
sessionTypes: cachedTimetable.sessionTypes,
rooms: cachedTimetable.rooms,
languages: cachedTimetable.languages,
languages: uniqueLanguages,
timeGroupTimetableItems: timetableTimeGroupItems
)
)
Expand Down

0 comments on commit 8e24f55

Please sign in to comment.