| 589 | }; |
| 590 | |
| 591 | const countRemainingUploadConflicts = ( |
| 592 | files: SelectedUploadFile[], |
| 593 | startIndex: number, |
| 594 | occupiedNames: Set<string> |
| 595 | ) => { |
| 596 | const simulatedOccupiedNames = new Set(occupiedNames); |
| 597 | let count = 0; |
| 598 | |
| 599 | for (let i = startIndex; i < files.length; i++) { |
| 600 | const fileName = files[i].file.name; |
| 601 | if (simulatedOccupiedNames.has(fileName)) count += 1; |
| 602 | simulatedOccupiedNames.add(fileName); |
| 603 | } |
| 604 | |
| 605 | return count; |
| 606 | }; |
| 607 | |
| 608 | const confirmUploadConflict = async ( |
| 609 | fileName: string, |