Merge pull request #9639 from mfo/US/fix-missing-autosave-end-for-file-upload

correctif(upload): ETQ usager, lorsque j'upload un fichier, ca bloquele bouton pour deposer un dossier
This commit is contained in:
mfo 2023-10-25 09:02:11 +00:00 committed by GitHub
commit b9b9569852
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,17 +165,25 @@ export class AutosaveController extends ApplicationController {
private enqueueAutouploadRequest(target: HTMLInputElement, file: File) {
const autoupload = new AutoUpload(target, file);
autoupload.start().catch((e) => {
const error = e as FileUploadError;
// Report unexpected client errors to Sentry.
// (But ignore usual client errors, or errors we can monitor better on the server side.)
if (
error.failureReason == FAILURE_CLIENT &&
error.code != ERROR_CODE_READ
) {
throw error;
}
});
autoupload
.start()
.catch((e) => {
const error = e as FileUploadError;
this.globalDispatch('autosave:error');
// Report unexpected client errors to Sentry.
// (But ignore usual client errors, or errors we can monitor better on the server side.)
if (
error.failureReason == FAILURE_CLIENT &&
error.code != ERROR_CODE_READ
) {
throw error;
}
})
.then(() => {
this.globalDispatch('autosave:end');
});
}
// Add a new autosave request to the queue.