mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Implement basic publishing
This commit is contained in:
parent
acde0c8978
commit
7398c1d3cf
@ -70,8 +70,13 @@ struct ContentView: View {
|
||||
}
|
||||
ToolbarItemGroup(placement: .primaryAction) {
|
||||
if let selectedPost = model.selectedPost {
|
||||
Button(action: {}, label: { Image(systemName: "paperplane") })
|
||||
.disabled(selectedPost.body.isEmpty)
|
||||
Button(action: {
|
||||
DispatchQueue.main.async {
|
||||
LocalStorageManager().saveContext()
|
||||
model.publish(post: selectedPost)
|
||||
}
|
||||
}, label: { Image(systemName: "paperplane") })
|
||||
.disabled(selectedPost.body.isEmpty || selectedPost.status == PostStatus.published.rawValue)
|
||||
Button(action: {}, label: { Image(systemName: "square.and.arrow.up") })
|
||||
.disabled(selectedPost.status == PostStatus.local.rawValue)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user