mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 02:01:02 +00:00
Disable post button when there's no content (#57)
Co-authored-by: Pascal Batty <pascal@zen.ly>
This commit is contained in:
parent
0ae0b7e33f
commit
cd78cab073
2 changed files with 4 additions and 0 deletions
|
@ -84,6 +84,7 @@ public struct StatusEditorView: View {
|
|||
Text("Post")
|
||||
}
|
||||
}
|
||||
.disabled(!viewModel.canPost)
|
||||
}
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button {
|
||||
|
|
|
@ -44,6 +44,9 @@ public class StatusEditorViewModel: ObservableObject {
|
|||
@Published var mediasImages: [ImageContainer] = []
|
||||
@Published var replyToStatus: Status?
|
||||
@Published var embededStatus: Status?
|
||||
var canPost: Bool {
|
||||
statusText.length > 0 || !selectedMedias.isEmpty
|
||||
}
|
||||
|
||||
@Published var visibility: Models.Visibility = .pub
|
||||
|
||||
|
|
Loading…
Reference in a new issue