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:
commit
b9b9569852
1 changed files with 19 additions and 11 deletions
|
@ -165,17 +165,25 @@ export class AutosaveController extends ApplicationController {
|
||||||
|
|
||||||
private enqueueAutouploadRequest(target: HTMLInputElement, file: File) {
|
private enqueueAutouploadRequest(target: HTMLInputElement, file: File) {
|
||||||
const autoupload = new AutoUpload(target, file);
|
const autoupload = new AutoUpload(target, file);
|
||||||
autoupload.start().catch((e) => {
|
autoupload
|
||||||
const error = e as FileUploadError;
|
.start()
|
||||||
// Report unexpected client errors to Sentry.
|
.catch((e) => {
|
||||||
// (But ignore usual client errors, or errors we can monitor better on the server side.)
|
const error = e as FileUploadError;
|
||||||
if (
|
|
||||||
error.failureReason == FAILURE_CLIENT &&
|
this.globalDispatch('autosave:error');
|
||||||
error.code != ERROR_CODE_READ
|
|
||||||
) {
|
// Report unexpected client errors to Sentry.
|
||||||
throw error;
|
// (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.
|
// Add a new autosave request to the queue.
|
||||||
|
|
Loading…
Reference in a new issue