From f9bec93e709a5db2a056bd7da1404e98af1fa764 Mon Sep 17 00:00:00 2001 From: Elena Willen Date: Tue, 21 May 2024 13:10:36 +0200 Subject: [PATCH] fix: Set isShowingDiscovery to false instead of hiding the view --- Mail/Views/New Message/ComposeMessageView.swift | 12 +++++------- Mail/Views/SplitView.swift | 14 ++++++-------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Mail/Views/New Message/ComposeMessageView.swift b/Mail/Views/New Message/ComposeMessageView.swift index d374783030..cc96822bd9 100644 --- a/Mail/Views/New Message/ComposeMessageView.swift +++ b/Mail/Views/New Message/ComposeMessageView.swift @@ -231,7 +231,7 @@ struct ComposeMessageView: View { initialAttachments = [] if featureFlagsManager.isEnabled(.aiMailComposer) && UserDefaults.shared.shouldPresentAIFeature { - aiModel.isShowingDiscovery = true + aiModel.isShowingDiscovery = platformDetector.isMac ? false : true return } @@ -272,12 +272,10 @@ struct ComposeMessageView: View { } } .discoveryPresenter(isPresented: $aiModel.isShowingDiscovery) { - if !platformDetector.isMac { - DiscoveryView(item: .aiDiscovery) { - UserDefaults.shared.shouldPresentAIFeature = false - } completionHandler: { willShowAIPrompt in - aiModel.isShowingPrompt = willShowAIPrompt - } + DiscoveryView(item: .aiDiscovery) { + UserDefaults.shared.shouldPresentAIFeature = false + } completionHandler: { willShowAIPrompt in + aiModel.isShowingPrompt = willShowAIPrompt } } .aiPromptPresenter(isPresented: $aiModel.isShowingPrompt) { diff --git a/Mail/Views/SplitView.swift b/Mail/Views/SplitView.swift index 68cdb15751..617fdaf742 100644 --- a/Mail/Views/SplitView.swift +++ b/Mail/Views/SplitView.swift @@ -124,13 +124,11 @@ struct SplitView: View { } } .discoveryPresenter(isPresented: $mainViewState.isShowingSyncDiscovery) { - if !platformDetector.isMac { - DiscoveryView(item: .syncDiscovery) { - UserDefaults.shared.shouldPresentSyncDiscovery = false - } completionHandler: { willSync in - guard willSync else { return } - mainViewState.isShowingSyncProfile = true - } + DiscoveryView(item: .syncDiscovery) { + UserDefaults.shared.shouldPresentSyncDiscovery = false + } completionHandler: { willSync in + guard willSync else { return } + mainViewState.isShowingSyncProfile = true } } .discoveryPresenter(isPresented: $mainViewState.isShowingSetAppAsDefaultDiscovery) { @@ -167,7 +165,7 @@ struct SplitView: View { try await mailboxManager.refreshAllSignatures() } guard !platformDetector.isDebug else { return } - mainViewState.isShowingSyncDiscovery = shouldShowSync() + mainViewState.isShowingSyncDiscovery = platformDetector.isMac ? false : shouldShowSync() } } .onOpenURL { url in