Ignore folders when displaying deleted items

This commit is contained in:
Jackson Harper
2024-02-06 14:06:35 +08:00
parent ad0bf56aed
commit 986b664a36
3 changed files with 6 additions and 2 deletions

View File

@ -170,7 +170,7 @@ import Views
var subPredicates = [NSPredicate]()
// TODO: FOLLOWING MIGRATION: invert this once the following migration has completed
if !UserDefaults.standard.bool(forKey: "LibraryTabView::hideFollowingTab") {
if !(filterState.appliedFilter?.ignoreFolders ?? false), !UserDefaults.standard.bool(forKey: "LibraryTabView::hideFollowingTab") {
let folderPredicate = NSPredicate(
format: "%K == %@", #keyPath(Models.LibraryItem.folder), filterState.folder
)

View File

@ -309,7 +309,7 @@ private let syncItemEdgeSelection = Selection.SyncUpdatedItemEdge {
}
private let searchItemSelection = Selection.SearchItem {
InternalLibraryItem(
return InternalLibraryItem(
id: try $0.id(),
title: try $0.title(),
createdAt: try $0.createdAt().value ?? Date(),

View File

@ -208,6 +208,10 @@ public struct InternalFilter: Encodable, Identifiable, Hashable, Equatable {
predicate != nil
}
public var ignoreFolders: Bool {
return name == "Deleted"
}
public var predicate: NSPredicate? {
let undeletedPredicate = NSPredicate(
format: "%K != %i AND %K != \"DELETED\"",