Skip to content

Commit

Permalink
Merge pull request #733 from Infomaniak/nextThread
Browse files Browse the repository at this point in the history
fix(NextThread): Get nextThread if thread list is not empty
  • Loading branch information
PhilippeWeidmann committed May 4, 2023
2 parents 0475f97 + cd1166b commit a970fdb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Mail/Views/Thread List/ThreadListViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ class DateSection: Identifiable {

func nextThreadIfNeeded(from threads: [Thread]) {
guard !isCompact,
!threads.isEmpty,
!threads.contains(where: { $0.uid == selectedThread?.uid }),
let lastIndex = selectedThreadIndex else { return }
let validIndex = min(lastIndex, threads.count - 1)
Expand Down

0 comments on commit a970fdb

Please sign in to comment.