Commit 7f72f648 by Orkhan Alikhanov

Fixe cancel callback is called even dialog wasn't actually cancelled

parent 8e093df0
...@@ -119,7 +119,6 @@ open class DialogController<T: DialogView>: UIViewController { ...@@ -119,7 +119,6 @@ open class DialogController<T: DialogView>: UIViewController {
} }
dismiss(isTriggeredByUserInteraction: true, isAnimated: true) dismiss(isTriggeredByUserInteraction: true, isAnimated: true)
didCancelHandler?()
} }
/// Handler for when one of 3 dialog buttons is tapped. /// Handler for when one of 3 dialog buttons is tapped.
...@@ -177,5 +176,11 @@ private extension DialogController { ...@@ -177,5 +176,11 @@ private extension DialogController {
} }
presentingViewController?.dismiss(animated: isAnimated, completion: nil) presentingViewController?.dismiss(animated: isAnimated, completion: nil)
guard isTriggeredByUserInteraction, nil == button else {
return
}
didCancelHandler?()
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment