mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Disable publish and reload buttons based on network connection status
This commit is contained in:
parent
52335d5d48
commit
d7a6668917
@ -34,7 +34,11 @@ struct PostEditorView: View {
|
||||
}, label: {
|
||||
Image(systemName: "paperplane")
|
||||
})
|
||||
.disabled(post.status == PostStatus.published.rawValue || !model.account.isLoggedIn)
|
||||
.disabled(
|
||||
post.status == PostStatus.published.rawValue ||
|
||||
!model.account.isLoggedIn ||
|
||||
!model.hasNetworkConnection
|
||||
)
|
||||
}
|
||||
}
|
||||
.onChange(of: post.hasNewerRemoteCopy, perform: { _ in
|
||||
|
@ -41,7 +41,7 @@ struct PostListView: View {
|
||||
}, label: {
|
||||
Image(systemName: "arrow.clockwise")
|
||||
})
|
||||
.disabled(!model.account.isLoggedIn)
|
||||
.disabled(!model.account.isLoggedIn || !model.hasNetworkConnection)
|
||||
}
|
||||
.padding()
|
||||
.frame(width: geometry.size.width)
|
||||
@ -67,7 +67,7 @@ struct PostListView: View {
|
||||
}, label: {
|
||||
Image(systemName: "arrow.clockwise")
|
||||
})
|
||||
.disabled(!model.account.isLoggedIn)
|
||||
.disabled(!model.account.isLoggedIn || !model.hasNetworkConnection)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user