Skip to content

Commit

Permalink
[5.x] Fix asset upload concurrency on folder upload (#11225)
Browse files Browse the repository at this point in the history
  • Loading branch information
daun authored Dec 11, 2024
1 parent 26751a9 commit 7ecc2be
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions resources/js/components/assets/Uploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ export default {
},
computed: {
activeUploads() {
return this.uploads.filter(u => u.instance.state === 'started');
}
},
methods: {
browse() {
Expand Down Expand Up @@ -230,6 +239,9 @@ export default {
},
processUploadQueue() {
// If we're already uploading, don't start another
if (this.activeUploads.length) return;
// Make sure we're not grabbing a running or failed upload
const upload = this.uploads.find(u => u.instance.state === 'new' && !u.errorMessage);
if (!upload) return;
Expand All @@ -248,6 +260,8 @@ export default {
response.status === 200
? this.handleUploadSuccess(id, json)
: this.handleUploadError(id, response.status, json);
this.processUploadQueue();
});
},
Expand Down

0 comments on commit 7ecc2be

Please sign in to comment.