Skip to content

Commit

Permalink
Add short delay before presenting push notification dialog (to preven…
Browse files Browse the repository at this point in the history
…t accidental dismissal)
  • Loading branch information
amy-at-kickstarter committed Mar 18, 2024
1 parent c558498 commit c04f6c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Kickstarter-iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ internal final class AppDelegate: UIResponder, UIApplicationDelegate {
})
)

DispatchQueue.main.async {
// Sometimes, the "# for push" popup doesn't appear when you # via web authentication session.
// My best guess is that this happens because the dismissal of the web login screen accidentally dismisses this popup, too.
// The delay isn't pretty, but it works.

DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
if let viewController = notification.userInfo?[UserInfoKeys.viewController] as? UIViewController {
viewController.present(alert, animated: true, completion: nil)
} else {
Expand Down

0 comments on commit c04f6c2

Please # to comment.