diff options
Diffstat (limited to 'iosApp/iosApp/Details/Commands/UnitCommandsView.swift')
-rw-r--r-- | iosApp/iosApp/Details/Commands/UnitCommandsView.swift | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/iosApp/iosApp/Details/Commands/UnitCommandsView.swift b/iosApp/iosApp/Details/Commands/UnitCommandsView.swift index 9e4b280..eef3ae4 100644 --- a/iosApp/iosApp/Details/Commands/UnitCommandsView.swift +++ b/iosApp/iosApp/Details/Commands/UnitCommandsView.swift @@ -39,10 +39,19 @@ struct UnitCommandsView: View { }.pickerStyle(InlinePickerStyle()) Button { - unitCommandsViewModel.sendCommand() + unitCommandsViewModel.showConfirmation = true } label: { Label("send-command", systemImage: "paperplane") } + .disabled(unitCommandsViewModel.notSelected) + .actionSheet(isPresented: $unitCommandsViewModel.showConfirmation) { + ActionSheet(title: Text("send-command-confirm"), buttons: [ + .cancel(), + .destructive(Text("send-command")) { + unitCommandsViewModel.sendCommand() + } + ]) + } } } } |