Skip to content

Commit

Permalink
fix(iOS): multiple files selection
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpinedam committed May 8, 2024
1 parent 644e707 commit bf906b5
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 bf906b5

Please sign in to comment.