From 200a601d9741dffb9aaa99e0f554617480ad6b93 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Wed, 2 Oct 2024 10:34:15 +0100 Subject: [PATCH 1/2] Open bug reporter only once --- .../bug_report/actions/open_bug_report.dart | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/app/lib/features/bug_report/actions/open_bug_report.dart b/app/lib/features/bug_report/actions/open_bug_report.dart index 29fcdca0e092..5690abca2bb0 100644 --- a/app/lib/features/bug_report/actions/open_bug_report.dart +++ b/app/lib/features/bug_report/actions/open_bug_report.dart @@ -17,25 +17,29 @@ Future openBugReport( if (_bugReportOpen) { return; } - queryParams = queryParams ?? {}; - final cacheDir = await appCacheDir(); - // rage shake disallows dot in filename - final timestamp = DateTime.now().timestamp; - final imagePath = await screenshotController.captureAndSave( - cacheDir, - fileName: 'screenshot_$timestamp.png', - ); - if (imagePath != null) { - queryParams['screenshot'] = imagePath; - } - if (!context.mounted) { - _log.warning('Trying to open the bugreport without being mounted'); - return; - } _bugReportOpen = true; - await context.pushNamed( - Routes.bugReport.name, - queryParameters: queryParams, - ); - _bugReportOpen = false; + try { + queryParams = queryParams ?? {}; + final cacheDir = await appCacheDir(); + // rage shake disallows dot in filename + final timestamp = DateTime.now().timestamp; + final imagePath = await screenshotController.captureAndSave( + cacheDir, + fileName: 'screenshot_$timestamp.png', + ); + if (imagePath != null) { + queryParams['screenshot'] = imagePath; + } + if (!context.mounted) { + _log.warning('Trying to open the bugreport without being mounted'); + return; + } + _bugReportOpen = true; + await context.pushNamed( + Routes.bugReport.name, + queryParameters: queryParams, + ); + } finally { + _bugReportOpen = false; + } } From 3e72f159e346def0382578b9f8b403373ef1f659 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Wed, 2 Oct 2024 10:34:24 +0100 Subject: [PATCH 2/2] Fix pubspec --- app/pubspec.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/pubspec.lock b/app/pubspec.lock index ca6a99dda500..c22c20ed5e55 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -2658,10 +2658,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.4" + version: "14.2.5" volume_controller: dependency: transitive description: