#1747 (marking a feed as read takes you to the wrong feed)

- Fixed crash with unread focus.
This commit is contained in:
David Sinclair 2022-11-19 18:40:46 -06:00
parent 739c61fe4a
commit 6a47503ef4

View file

@ -1959,14 +1959,19 @@ heightForHeaderInSection:(NSInteger)section {
if (sender == nil) {
FeedTableCell *cell = (FeedTableCell *)[self tableView:feedTitlesTable cellForRowAtIndexPath:indexPath];
NSString *folderName = [appDelegate.dictFoldersArray objectAtIndex:indexPath.section];
id feedId = [[appDelegate.dictFolders objectForKey:folderName] objectAtIndex:indexPath.row];
NSString *feedIdStr = [NSString stringWithFormat:@"%@", feedId];
BOOL hasUnread = cell.positiveCount > 0 || cell.neutralCount > 0 || cell.negativeCount > 0;
BOOL isInactive = appDelegate.dictInactiveFeeds[feedIdStr] != nil;
if ([cell.reuseIdentifier isEqualToString:@"BlankCellIdentifier"] || !hasUnread || isInactive) {
if ([cell.reuseIdentifier isEqualToString:@"BlankCellIdentifier"]) {
foundNext = NO;
} else {
NSString *folderName = [appDelegate.dictFoldersArray objectAtIndex:indexPath.section];
id feedId = [[appDelegate.dictFolders objectForKey:folderName] objectAtIndex:indexPath.row];
NSString *feedIdStr = [NSString stringWithFormat:@"%@", feedId];
BOOL hasUnread = cell.positiveCount > 0 || cell.neutralCount > 0 || cell.negativeCount > 0;
BOOL isInactive = appDelegate.dictInactiveFeeds[feedIdStr] != nil;
if (!hasUnread || isInactive) {
foundNext = NO;
}
}
}
} while (!foundNext && ![indexPath isEqual:stopAtIndexPath]);