Skip to content

Commit

Permalink
Merge pull request #1710 from barijaona/issue-1532
Browse files Browse the repository at this point in the history
Fix mark all read for folder containing smart folders
  • Loading branch information
josh64x2 authored Nov 24, 2023
2 parents de2400a + 153f938 commit 86c01a8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Vienna/Sources/Main window/ArticleController.m
Original file line number Diff line number Diff line change
Expand Up @@ -880,9 +880,9 @@ -(void)markAllFoldersReadByArray:(NSArray *)folderArray
}

// Smart and Search folders are not included in folderArray when you mark all subscriptions read,
// so we need to mark articles read if they're the current folder.
// so we need to mark articles read if they're the current folder or might be inside it.
Folder * currentFolder = [[Database sharedManager] folderFromID:currentFolderId];
if (currentFolder != nil && ![folderArray containsObject:currentFolder]) {
if (currentFolder != nil && (currentFolder.type == VNAFolderTypeGroup || ![folderArray containsObject:currentFolder])) {
for (Article * theArticle in folderArrayOfArticles)
[theArticle markRead:YES];
}
Expand Down Expand Up @@ -910,12 +910,11 @@ -(NSArray *)wrappedMarkAllFoldersReadInArray:(NSArray *)folderArray
[refArray addObjectsFromArray:articleArray];
[[OpenReader sharedManager] markAllReadInFolder:folder];
} else {
// For smart folders, we only mark all read the current folder to
// simplify things.
if (folderId == currentFolderId) {
[refArray addObjectsFromArray:currentArrayOfArticles];
[self innerMarkReadByArray:currentArrayOfArticles readFlag:YES];
}
// For smart folders, we only mark read articles which should be visible with current filters
NSString *filterString = APPCONTROLLER.filterString;
NSArray * articleArray = [self applyFilter:[folder articlesWithFilter:filterString]];
[refArray addObjectsFromArray:articleArray];
[self innerMarkReadByArray:articleArray readFlag:YES];
}
}
return [refArray copy];
Expand Down

0 comments on commit 86c01a8

Please sign in to comment.