-
-
Notifications
You must be signed in to change notification settings - Fork 325
fix: uid conflict when multiple upload components paste at same time #686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -95,7 +95,12 @@ class AjaxUploader extends Component<UploadProps> { | |||||
| const { multiple, directory } = this.props; | ||||||
|
|
||||||
| const items: DataTransferItem[] = [...(dataTransfer.items || [])]; | ||||||
| let files: File[] = [...(dataTransfer.files || [])]; | ||||||
| let files: File[] = [...(dataTransfer.files || [])].map(file => ( | ||||||
| new File([file], file.name, { | ||||||
| type: file.type, | ||||||
| lastModified: file.lastModified, | ||||||
| }) | ||||||
| )); | ||||||
|
|
||||||
| if (files.length > 0 || items.some(item => item.kind === 'file')) { | ||||||
| existFileCallback?.(); | ||||||
|
|
@@ -296,7 +301,6 @@ class AjaxUploader extends Component<UploadProps> { | |||||
| delete this.reqs[uid]; | ||||||
| }, | ||||||
| }; | ||||||
|
||||||
| }; | |
| }; |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -318,7 +318,7 @@ describe('uploader', () => { | |||
| Object.defineProperty(files, 'item', { | ||||
| value: i => files[i], | ||||
| }); | ||||
|
|
||||
|
||||
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Consider removing it for consistency with the codebase style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.