Skip to content

Commit

Permalink
fix(iOS): MessageDialog programatically dismissal
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpinedam committed Dec 15, 2021
1 parent ca19b95 commit 8b1fc1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Uno.UWP/UI/Popups/MessageDialog.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ private async Task<IUICommand> ShowInner(CancellationToken ct)
{
alertController.PreferredAction = alertActions.ElementAtOrDefault((int)DefaultCommandIndex);
}

using (ct.Register(() =>
{
// If the cancellation token itself gets cancelled, we cancel as well.
result.TrySetCanceled();
UIApplication.SharedApplication.KeyWindow?.RootViewController?.DismissViewController(false, () => { });
}))
}, useSynchronizationContext: true))
{
await _viewControllerAccess.WaitAsync(ct);

Expand Down

0 comments on commit 8b1fc1f

Please sign in to comment.