Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
Essentials: Port xamarin/Essentials#1765 (#1639)
Browse files Browse the repository at this point in the history
  • Loading branch information
Redth authored Jul 21, 2021
1 parent a71913b commit bf2ac91
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/MediaPicker/MediaPicker.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ static async Task<FileResult> PhotoAsync(MediaPickerOptions options, bool photo,
var tcs = new TaskCompletionSource<FileResult>(picker);
picker.Delegate = new PhotoPickerDelegate
{
CompletedHandler = info => GetFileResult(info, tcs)
CompletedHandler = async info =>
{
GetFileResult(info, tcs);
await vc.DismissViewControllerAsync(true);
}
};

if (picker.PresentationController != null)
Expand All @@ -80,8 +84,6 @@ static async Task<FileResult> PhotoAsync(MediaPickerOptions options, bool photo,

var result = await tcs.Task;

await vc.DismissViewControllerAsync(true);

picker?.Dispose();
picker = null;

Expand Down

0 comments on commit bf2ac91

Please sign in to comment.