mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Open the settings screen on publish if not logged in [iOS only for now]
This commit is contained in:
parent
e736ebbb8c
commit
e735e7a3d1
@ -125,14 +125,16 @@ struct PostEditorView: View {
|
||||
}
|
||||
ToolbarItemGroup(placement: .navigationBarTrailing) {
|
||||
Button(action: {
|
||||
publishPost()
|
||||
if model.account.isLoggedIn {
|
||||
publishPost()
|
||||
} else {
|
||||
self.model.isPresentingSettingsView = true
|
||||
}
|
||||
}, label: {
|
||||
Image(systemName: "paperplane")
|
||||
})
|
||||
.disabled(
|
||||
post.status == PostStatus.published.rawValue ||
|
||||
!model.account.isLoggedIn ||
|
||||
!model.hasNetworkConnection
|
||||
post.status == PostStatus.published.rawValue || !model.hasNetworkConnection || post.body.count == 0
|
||||
)
|
||||
Button(action: {
|
||||
sharePost()
|
||||
|
@ -112,14 +112,16 @@ struct PostEditorView: View {
|
||||
}
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button(action: {
|
||||
publishPost()
|
||||
if model.account.isLoggedIn {
|
||||
publishPost()
|
||||
} else {
|
||||
// TODO: Open the Preferences window.
|
||||
}
|
||||
}, label: {
|
||||
Image(systemName: "paperplane")
|
||||
})
|
||||
.disabled(
|
||||
post.status == PostStatus.published.rawValue ||
|
||||
!model.account.isLoggedIn ||
|
||||
!model.hasNetworkConnection
|
||||
post.status == PostStatus.published.rawValue || !model.hasNetworkConnection || post.body.count == 0
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user