From eea5486563e5c51b5fdd22942475c7272bf2920f Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 4 Oct 2024 15:45:40 +0200 Subject: [PATCH] Fix crash on "Report issue" --- .../Views/Diagnostics/iOS/ReportIssueButton+iOS.swift | 2 ++ .../Diagnostics/macOS/ReportIssueButton+macOS.swift | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Passepartout/Library/Sources/AppUI/Views/Diagnostics/iOS/ReportIssueButton+iOS.swift b/Passepartout/Library/Sources/AppUI/Views/Diagnostics/iOS/ReportIssueButton+iOS.swift index 1db7ecac..6b690c19 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Diagnostics/iOS/ReportIssueButton+iOS.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Diagnostics/iOS/ReportIssueButton+iOS.swift @@ -60,6 +60,8 @@ extension ReportIssueButton: View { } private extension ReportIssueButton { + + @MainActor func sendEmail() { Task { isPending = true diff --git a/Passepartout/Library/Sources/AppUI/Views/Diagnostics/macOS/ReportIssueButton+macOS.swift b/Passepartout/Library/Sources/AppUI/Views/Diagnostics/macOS/ReportIssueButton+macOS.swift index dd01532b..064bfd71 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Diagnostics/macOS/ReportIssueButton+macOS.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Diagnostics/macOS/ReportIssueButton+macOS.swift @@ -37,16 +37,18 @@ extension ReportIssueButton: View { } private extension ReportIssueButton { + + @MainActor func sendEmail() { Task { - guard let service = NSSharingService(named: .composeEmail) else { - isUnableToEmail = true - return - } isPending = true defer { isPending = false } + guard let service = NSSharingService(named: .composeEmail) else { + isUnableToEmail = true + return + } let issue = await Issue.withMetadata(.init( configuration: .shared, versionString: BundleConfiguration.mainVersionString,