Respect user cancelling upload flow by dismissing spinner (#10373)
This commit is contained in:
parent
1c9ea423c9
commit
d850c95099
1 changed files with 7 additions and 2 deletions
|
@ -378,8 +378,13 @@ export default class ContentMessages {
|
||||||
if (!this.mediaConfig) {
|
if (!this.mediaConfig) {
|
||||||
// hot-path optimization to not flash a spinner if we don't need to
|
// hot-path optimization to not flash a spinner if we don't need to
|
||||||
const modal = Modal.createDialog(Spinner, undefined, "mx_Dialog_spinner");
|
const modal = Modal.createDialog(Spinner, undefined, "mx_Dialog_spinner");
|
||||||
await this.ensureMediaConfigFetched(matrixClient);
|
await Promise.race([this.ensureMediaConfigFetched(matrixClient), modal.finished]);
|
||||||
modal.close();
|
if (!this.mediaConfig) {
|
||||||
|
// User cancelled by clicking away on the spinner
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
modal.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const tooBigFiles: File[] = [];
|
const tooBigFiles: File[] = [];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue