mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Merge pull request #151 from writeas/improve-new-post-reliability
Improve new-post reliability
This commit is contained in:
commit
7a86da92a2
@ -87,7 +87,16 @@ struct PostListFilteredView: View {
|
||||
tag: post,
|
||||
selection: $model.selectedPost
|
||||
) {
|
||||
PostCellView(post: post)
|
||||
if 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)
|
||||
}
|
||||
}
|
||||
.deleteDisabled(post.status != PostStatus.local.rawValue)
|
||||
}
|
||||
|
@ -104,9 +104,9 @@ struct PostListView: View {
|
||||
}
|
||||
.onDisappear {
|
||||
DispatchQueue.main.async {
|
||||
model.selectedCollection = nil
|
||||
model.showAllPosts = true
|
||||
model.selectedPost = nil
|
||||
self.model.selectedCollection = nil
|
||||
self.model.showAllPosts = true
|
||||
self.model.selectedPost = nil
|
||||
}
|
||||
}
|
||||
.navigationTitle(
|
||||
|
Loading…
Reference in New Issue
Block a user