Skip to content

Commit

Permalink
Merge pull request #1553 from nextcloud/fix-scrolling-to-unread-messages
Browse files Browse the repository at this point in the history
Fix crash when scrolling to unread messages
  • Loading branch information
Ivansss authored Feb 26, 2024
2 parents c1aa5ec + efa8479 commit 4cd635b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NextcloudTalk/RoomsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ - (void)updateMentionsIndicator
for (int i = (int)lastVisibleRowIndexPath.row; i <= (int)_lastRoomWithMentionIndexPath.row; i++) {
NCRoom *room = [_rooms objectAtIndex:i];
if (room.hasUnreadMention) {
_nextRoomWithMentionIndexPath = [NSIndexPath indexPathForRow:i inSection:0];
_nextRoomWithMentionIndexPath = [NSIndexPath indexPathForRow:i inSection:1];
break;
}
}
Expand Down Expand Up @@ -928,7 +928,7 @@ - (void)calculateLastRoomWithMention
for (int i = 0; i < _rooms.count; i++) {
NCRoom *room = [_rooms objectAtIndex:i];
if (room.hasUnreadMention) {
_lastRoomWithMentionIndexPath = [NSIndexPath indexPathForRow:i inSection:0];
_lastRoomWithMentionIndexPath = [NSIndexPath indexPathForRow:i inSection:1];
}
}
}
Expand Down Expand Up @@ -1599,7 +1599,7 @@ - (void)highlightSelectedRoom
}];

if (idx != NSNotFound) {
NSIndexPath* indexPath = [NSIndexPath indexPathForRow:idx inSection:0];
NSIndexPath* indexPath = [NSIndexPath indexPathForRow:idx inSection:1];
[self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
}
} else {
Expand Down

0 comments on commit 4cd635b

Please sign in to comment.