Fix CollectionSidebar preview and remove dead showPosts code

This commit is contained in:
Angelo Stavrow 2020-08-07 09:53:16 -04:00
parent 1dc8b4c7ce
commit fce0c380d2
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -18,13 +18,9 @@ struct CollectionSidebar: View {
.listStyle(SidebarListStyle())
}
func showPosts(for collection: PostCollection) -> [Post] {
if collection == allPostsCollection {
return postStore.posts
} else {
return postStore.posts.filter {
$0.collection.title == collection.title
}
}
struct CollectionSidebar_Previews: PreviewProvider {
static var previews: some View {
CollectionSidebar()
.environmentObject(testPostStore)
}
}