Skip to content

Commit

Permalink
fix: Delay DefaultDiscoveryView after ComposeView dismiss
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Feb 5, 2024
1 parent 467eed8 commit ce19fd3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Mail/Views/New Message/ComposeMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ struct ComposeMessageView: View {
sendDraft()

if !Bundle.main.isExtension {
mainViewState.isShowingSetAppAsDefaultDiscovery = UserDefaults.shared.shouldPresentSetAsDefaultDiscovery
// We should implement a proper router to avoid doing this
DispatchQueue.main.asyncAfter(deadline: UIConstants.modalCloseDelay) {
mainViewState.isShowingSetAppAsDefaultDiscovery = UserDefaults.shared.shouldPresentSetAsDefaultDiscovery
}
if !mainViewState.isShowingSetAppAsDefaultDiscovery {
mainViewState.isShowingChristmasEasterEgg = true
}
Expand Down
4 changes: 4 additions & 0 deletions MailCore/UI/UIConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ public extension UIConstants {
public extension UIConstants {
static let checkboxAppearDelay = 0.2
static let checkboxDisappearOffsetDelay = 0.35

static var modalCloseDelay: DispatchTime {
DispatchTime.now() + 0.75
}
}

// MARK: - Utils
Expand Down

0 comments on commit ce19fd3

Please sign in to comment.