Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F13831056
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
View Options
diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift
index 748aaa6..f7ffd51 100644
--- a/Shared/Navigation/ContentView.swift
+++ b/Shared/Navigation/ContentView.swift
@@ -1,43 +1,42 @@
import SwiftUI
struct ContentView: View {
@ObservedObject var postStore: PostStore
@State private var selectedCollection: PostCollection? = allPostsCollection
var body: some View {
NavigationView {
CollectionSidebar(selectedCollection: $selectedCollection)
PostList(
title: selectedCollection?.title ?? allPostsCollection.title,
posts: showPosts(for: selectedCollection ?? allPostsCollection)
)
- .frame(maxHeight: .infinity)
.toolbar {
NavigationLink(destination: PostEditor(post: Post())) {
Image(systemName: "square.and.pencil")
}
}
Text("Select a post, or create a new draft.")
.foregroundColor(.secondary)
}
.environmentObject(postStore)
}
func showPosts(for collection: PostCollection) -> [Post] {
if collection == allPostsCollection {
return postStore.posts
} else {
return postStore.posts.filter {
$0.collection.title == collection.title
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView(postStore: testPostStore)
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Feb 20, 6:57 AM (18 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3633756
Attached To
rWFSUI WriteFreely SwiftUI
Event Timeline
Log In to Comment