From 5bc2d750517da5bfadf8afe55bd1b621ba2d11ac Mon Sep 17 00:00:00 2001 From: Codel1417 Date: Sat, 1 Jun 2024 16:29:02 -0400 Subject: [PATCH] change save & clear behavior --- lib/Frontend/pages/action_selector.dart | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/Frontend/pages/action_selector.dart b/lib/Frontend/pages/action_selector.dart index 13009aa9..4b9246e4 100644 --- a/lib/Frontend/pages/action_selector.dart +++ b/lib/Frontend/pages/action_selector.dart @@ -46,12 +46,22 @@ class _ActionSelectorState extends ConsumerState { title: Text(actionsSelectScreen()), actions: [ IconButton( - onPressed: () => context.pop(selected), + onPressed: () { + if (selected.isEmpty) { + context.pop(true); + } else { + context.pop(selected); + } + }, icon: const Icon(Icons.save), tooltip: triggersSelectSaveLabel(), ), IconButton( - onPressed: () => context.pop(true), + onPressed: () { + setState(() { + selected.clear(); + }); + }, icon: const Icon(Icons.clear), tooltip: triggersSelectClearLabel(), )