From f0ff1b48a279940b26324aabf2da2354a73d00ca Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Wed, 29 Oct 2025 14:56:37 +0100 Subject: [PATCH] remove generic open tab snackbar --- app/lib/utils/ui_helper.dart | 37 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/app/lib/utils/ui_helper.dart b/app/lib/utils/ui_helper.dart index a85780d8..35b0d037 100644 --- a/app/lib/utils/ui_helper.dart +++ b/app/lib/utils/ui_helper.dart @@ -84,30 +84,21 @@ Future showSuggestNewTabMessage( }) async { final clipboardUrl = await tryGetUriFromClipboard(); - final snackBar = (clipboardUrl != null) - ? SnackBar( - content: const Text('Want to open link from clipboard?'), - action: SnackBarAction( - label: 'Open', - onPressed: () { - onAdd(clipboardUrl.toString()); - }, - ), - duration: duration, - ) - : SnackBar( - content: const Text('Want to open a new tab?'), - action: SnackBarAction( - label: 'New Tab', - onPressed: () { - onAdd(null); - }, - ), - duration: duration, - ); + if (clipboardUrl != null) { + final snackBar = SnackBar( + content: const Text('Want to open link from clipboard?'), + action: SnackBarAction( + label: 'Open', + onPressed: () { + onAdd(clipboardUrl.toString()); + }, + ), + duration: duration, + ); - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar(snackBar); + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar(snackBar); + } } }