Page MenuHomeMusing Studio

No OneTemporary

diff --git a/Shared/PostList/SearchablePostListFilteredView.swift b/Shared/PostList/SearchablePostListFilteredView.swift
index 56d2c29..6f3e5b9 100644
--- a/Shared/PostList/SearchablePostListFilteredView.swift
+++ b/Shared/PostList/SearchablePostListFilteredView.swift
@@ -1,35 +1,47 @@
import SwiftUI
@available(iOS 15, macOS 12.0, *)
struct SearchablePostListFilteredView: View {
@EnvironmentObject var model: WriteFreelyModel
@State private var searchString = ""
var collections: FetchedResults<WFACollection>
var fetchRequest: FetchRequest<WFAPost>
var onDelete: (WFAPost) -> Void
var body: some View {
if #available(iOS 16, macOS 13, *) {
+ /// TODO: Add back post search
NavigationStack {
List(fetchRequest.wrappedValue, id: \.self, selection: $model.navState.selectedPost) { post in
NavigationLink(
- "\(post.title.isEmpty ? "UNTITLED" : post.title)",
- destination: PostEditorView(post: post)
+ destination: PostEditorView(post: post),
+ label: {
+ if model.navState.showAllPosts {
+ if let collection = collections.filter({ $0.alias == post.collectionAlias }).first {
+ PostCellView(post: post, collectionName: collection.title)
+ } else {
+ let collectionName = model.account.server == "https://write.as" ? "Anonymous" : "Drafts"
+ PostCellView(post: post, collectionName: collectionName)
+ }
+ } else {
+ PostCellView(post: post)
+ }
+ }
)
}
}
} else {
DeprecatedListView(
searchString: $searchString,
collections: collections,
fetchRequest: fetchRequest,
onDelete: onDelete
)
}
}
func delete(_ post: WFAPost) {
onDelete(post)
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 11:40 AM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3105209

Event Timeline