Skip to content

Commit

Permalink
fix: Set isShowingDiscovery to false instead of hiding the view
Browse files Browse the repository at this point in the history
  • Loading branch information
Lnamw committed May 21, 2024
1 parent 9247d72 commit fcd2840
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
12 changes: 5 additions & 7 deletions Mail/Views/New Message/ComposeMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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) {
Expand Down
14 changes: 6 additions & 8 deletions Mail/Views/SplitView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fcd2840

Please sign in to comment.