You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
first: great article/tutorial about uploading files in Angular - thx.
What I noticed is that selected files are put into new Set() object and if you click on "Add files" multiple times, and add the same file, you get multiple records of the same file in the Set file object.
Isn't the purpose to use Set() object to avoid duplicates?
Thx, Bye.
The text was updated successfully, but these errors were encountered:
You are right, I didn't think that through.
Set is comparing its entries references if it stores objects. These will never be equal, when adding the same file multiple times.
Unfortunately, there seems to be no way to teach the Set a way to compare objects.
To fix this issue, one would probably use an array for easy iteration and a map (POJO) with the file name as a key to check if the file is already in the array.
Hi,
first: great article/tutorial about uploading files in Angular - thx.
What I noticed is that selected files are put into new Set() object and if you click on "Add files" multiple times, and add the same file, you get multiple records of the same file in the Set file object.
Isn't the purpose to use Set() object to avoid duplicates?
Thx, Bye.
The text was updated successfully, but these errors were encountered: