Hide compose attachment menu when there are no actions

This commit is contained in:
Shadowfacts 2025-02-07 12:13:39 -05:00
parent 8c67828185
commit 988b9b4793

View File

@ -41,17 +41,19 @@ private struct AttachmentOptionsMenu: View {
@Binding var recognizingText: Bool
var body: some View {
Menu {
if attachment.drawingData != nil {
EditDrawingButton(attachment: attachment)
} else if attachment.type == .image {
RecognizeTextButton(attachment: attachment, recognizingText: $recognizingText)
if attachment.drawingData != nil || attachment.type == .image {
Menu {
if attachment.drawingData != nil {
EditDrawingButton(attachment: attachment)
} else if attachment.type == .image {
RecognizeTextButton(attachment: attachment, recognizingText: $recognizingText)
}
} label: {
Label("Options", systemImage: "ellipsis.circle.fill")
}
} label: {
Label("Options", systemImage: "ellipsis.circle.fill")
.buttonStyle(AttachmentOverlayButtonStyle())
.padding([.top, .leading], 2)
}
.buttonStyle(AttachmentOverlayButtonStyle())
.padding([.top, .leading], 2)
}
}