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

Commit

Permalink
Merge pull request #790 from cassio-developer/bug640
Browse files Browse the repository at this point in the history
bugfix #640 clicking multiple times on a picture in iOS causing back …
  • Loading branch information
jamesmontemagno authored Dec 21, 2019
2 parents 6b60986 + e1af9b8 commit b12d1d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Media.Plugin/iOS/MediaPickerDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ public UIPopoverController Popover

public Task<List<MediaFile>> Task => tcs.Task;

private bool isFinished;
public override async void FinishedPickingMedia(UIImagePickerController picker, NSDictionary info)
{
if (isFinished)
return;
isFinished = true;
RemoveOrientationChangeObserverAndNotifications();

MediaFile mediaFile;
Expand Down Expand Up @@ -77,6 +81,7 @@ public override async void FinishedPickingMedia(UIImagePickerController picker,
tcs.SetException(new FileNotFoundException());
else
tcs.TrySetResult(new List<MediaFile> { mediaFile });
isFinished = false;
});
}

Expand Down

0 comments on commit b12d1d1

Please sign in to comment.