Merge pull request #94 from VernissageApp/bugfix/publish-without-text
Publish without text
This commit is contained in:
commit
67d393c272
|
@ -46,9 +46,5 @@ From time to time you have to come back and translate lines which has been added
|
||||||
Things that should be implemented in version 2.0:
|
Things that should be implemented in version 2.0:
|
||||||
|
|
||||||
- [ ] Use auto generated resources (Color/Images) instead static extensions (how to do this in separete Swift Packages?)
|
- [ ] Use auto generated resources (Color/Images) instead static extensions (how to do this in separete Swift Packages?)
|
||||||
- [x] Move to xcstring (new Xcode transaction system)
|
- [ ] Use ViewModels?
|
||||||
- [x] Move to new Observable macro (iOS 17)
|
|
||||||
- [x] Migrate to SwiftData (iOS 17)
|
|
||||||
- [ ] Use ViewModels
|
|
||||||
- [x] Add tips (new TipKit framework in iOS 17)
|
|
||||||
- [ ] Enable swiftlint (https://github.com/realm/SwiftLint/issues/5053)
|
- [ ] Enable swiftlint (https://github.com/realm/SwiftLint/issues/5053)
|
||||||
|
|
|
@ -196,7 +196,7 @@ struct InteractionRow: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func deleteStatus() {
|
private func deleteStatus() {
|
||||||
Task {
|
Task { @MainActor in
|
||||||
do {
|
do {
|
||||||
// Remove from server.
|
// Remove from server.
|
||||||
try await self.client.statuses?.delete(statusId: self.statusModel.id)
|
try await self.client.statuses?.delete(statusId: self.statusModel.id)
|
||||||
|
|
|
@ -581,11 +581,6 @@ public struct BaseComposeView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func isPublishButtonDisabled() -> Bool {
|
private func isPublishButtonDisabled() -> Bool {
|
||||||
// Publish always disabled when there is not status text.
|
|
||||||
if self.textModel.text.string.isEmpty {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// When application is during uploading photos we cannot send new status.
|
// When application is during uploading photos we cannot send new status.
|
||||||
if self.photosAreUploading == true {
|
if self.photosAreUploading == true {
|
||||||
return true
|
return true
|
||||||
|
@ -595,6 +590,11 @@ public struct BaseComposeView: View {
|
||||||
if self.statusViewModel == nil && self.photosAttachment.hasUploadedPhotos() == false {
|
if self.statusViewModel == nil && self.photosAttachment.hasUploadedPhotos() == false {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When status is a comment, then text is required.
|
||||||
|
if self.statusViewModel != nil && self.textModel.text.string.isEmpty {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue