Skip to content

Commit

Permalink
Merge pull request unoplatform#16634 from ajpinedam/fix/ios.multiple.…
Browse files Browse the repository at this point in the history
…file.selection

fix(iOS): multiple files selection
  • Loading branch information
jeromelaban authored May 9, 2024
2 parents 6315e7a + bf906b5 commit 4bf72fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Uno.UWP/Storage/Pickers/FileOpenPicker.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ public PhotoPickerDelegate(TaskCompletionSource<StorageFile?[]> taskCompletionSo
public override async void DidFinishPicking(PHPickerViewController picker, PHPickerResult[] results)
{
var storageFiles = await ConvertPickerResults(results);
_taskCompletionSource.SetResult(storageFiles.ToArray());

// This callback can be called multiple times, user tapping multiple times over the "add" button,
// we need to ensure that we only set the result once.
_taskCompletionSource.TrySetResult(storageFiles.ToArray());
}
private async Task<IEnumerable<StorageFile>> ConvertPickerResults(PHPickerResult[] results)
{
Expand Down

0 comments on commit 4bf72fb

Please sign in to comment.