Skip to content

Commit

Permalink
fix(ios/Modals): Don't success until dismissed (#2080)
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin-Credible authored and jcesarmobile committed Oct 23, 2019
1 parent 64cc133 commit 64aa6c7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ios/Capacitor/Capacitor/Plugins/Modals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ public class CAPModalsPlugin : CAPPlugin {
let buttonTitle = call.options["buttonTitle"] as? String ?? "OK"

let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert)
alert.addAction(UIAlertAction(title: buttonTitle, style: UIAlertAction.Style.default, handler: nil))
alert.addAction(UIAlertAction(title: buttonTitle, style: UIAlertAction.Style.default, handler: { (action) -> Void in
call.success()
}))

DispatchQueue.main.async {
self.bridge.viewController.present(alert, animated: true, completion: nil)
}

// Call success immediately
call.success()
}

@objc public func confirm(_ call: CAPPluginCall) {
Expand Down

0 comments on commit 64aa6c7

Please sign in to comment.