Page MenuHomeMusing Studio

No OneTemporary

diff --git a/Shared/PostList/SearchablePostListFilteredView.swift b/Shared/PostList/SearchablePostListFilteredView.swift
index 01abb81..5279fea 100644
--- a/Shared/PostList/SearchablePostListFilteredView.swift
+++ b/Shared/PostList/SearchablePostListFilteredView.swift
@@ -1,34 +1,39 @@
import SwiftUI
@available(iOS 15, macOS 12.0, *)
struct SearchablePostListFilteredView: View {
@EnvironmentObject var model: WriteFreelyModel
@Binding var postCount: Int
@State private var searchString = ""
// Only used for NavigationStack in iOS 16/macOS 13 or later
- @State private var path: [WFAPost] = []
+// @State private var path: [WFAPost] = []
var collections: FetchedResults<WFACollection>
var fetchRequest: FetchRequest<WFAPost>
var onDelete: (WFAPost) -> Void
var body: some View {
-// if #available(iOS 16, macOS 13, *) {
-// NavigationStack(path: $path) {
-// Text("Hello, modern stack navigator!")
-// }
-// } else {
- DeprecatedListView(
- searchString: $searchString,
- collections: collections,
- fetchRequest: fetchRequest,
- onDelete: onDelete
- )
-// }
+ if #available(iOS 16, macOS 13, *) {
+ NavigationStack {
+ List(fetchRequest.wrappedValue, id: \.self, selection: $model.selectedPost) { post in
+ NavigationLink(
+ "\(post.title.isEmpty ? "UNTITLED" : post.title)",
+ destination: PostEditorView(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
Fri, Jan 31, 4:45 PM (18 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3145912

Event Timeline