#1373 (saved searches on unread)

- Saved searches now appear in all intelligence views.
This commit is contained in:
David Sinclair 2020-09-22 20:52:10 -07:00
parent 165176cff6
commit 54f59259cb

View file

@ -1243,6 +1243,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
NSString *folderName = [appDelegate.dictFoldersArray objectAtIndex:indexPath.section];
id feedId = [[appDelegate.dictFolders objectForKey:folderName] objectAtIndex:indexPath.row];
NSString *feedIdStr = [NSString stringWithFormat:@"%@",feedId];
BOOL isSavedSearch = [appDelegate isSavedSearch:feedIdStr];
NSString *searchQuery = [appDelegate searchQueryForFeedId:feedIdStr];
NSString *searchFolder = [appDelegate searchFolderForFeedId:feedIdStr];
feedIdStr = [appDelegate feedIdWithoutSearchQuery:feedIdStr];
@ -1256,7 +1257,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
if (self.searchFeedIds && !isSaved) {
isOmitted = ![self.searchFeedIds containsObject:feedIdStr];
} else {
isOmitted = [appDelegate isFolderCollapsed:folderName] || ![self isFeedVisible:feedIdStr];
isOmitted = [appDelegate isFolderCollapsed:folderName] || !([self isFeedVisible:feedIdStr] || isSavedSearch);
}
if (isOmitted) {
@ -1800,7 +1801,9 @@ heightForHeaderInSection:(NSInteger)section {
NSDictionary *unreadCounts = self.appDelegate.dictUnreadCounts[feedId];
NSIndexPath *stillVisible = self.stillVisibleFeeds[feedId];
if (!stillVisible && self.appDelegate.isSavedStoriesIntelligenceMode) {
return [self.appDelegate savedStoriesCountForFeed:feedId] > 0 || [self.appDelegate isSavedFeed:feedId];
return [self.appDelegate savedStoriesCountForFeed:feedId] > 0 || [self.appDelegate isSavedFeed:feedId] || [self.appDelegate isSavedSearch:feedId];
} else if (!stillVisible && [self.appDelegate isSavedSearch:feedId]) {
return YES;
} else if (!stillVisible &&
appDelegate.selectedIntelligence >= 1 &&
[[unreadCounts objectForKey:@"ps"] intValue] <= 0) {