Skip to content

Commit

Permalink
Remove duplicates to avoid potential crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
defagos committed Nov 13, 2024
1 parent dfe6649 commit 50d7d1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class ProgramGuideDailyViewController: UIViewController {
var snapshot = NSDiffableDataSourceSnapshot<ProgramGuideDailyViewModel.Section, ProgramGuideDailyViewModel.Item>()
if let channel {
snapshot.appendSections([channel])
snapshot.appendItems(state.items(for: channel), toSection: channel)
snapshot.appendItems(removeDuplicates(in: state.items(for: channel)), toSection: channel)
}
return snapshot
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class ProgramGuideGridViewController: UIViewController {
var snapshot = NSDiffableDataSourceSnapshot<ProgramGuideDailyViewModel.Section, ProgramGuideDailyViewModel.Item>()
for section in state.sections {
snapshot.appendSections([section])
snapshot.appendItems(state.items(for: section), toSection: section)
snapshot.appendItems(removeDuplicates(in: state.items(for: section)), toSection: section)
}
return snapshot
}
Expand Down

0 comments on commit 50d7d1b

Please sign in to comment.