Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Respect user cancelling upload flow by dismissing spinner (#10373)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Mar 16, 2023
1 parent 1c9ea42 commit d850c95
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ContentMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,13 @@ export default class ContentMessages {
if (!this.mediaConfig) {
// hot-path optimization to not flash a spinner if we don't need to
const modal = Modal.createDialog(Spinner, undefined, "mx_Dialog_spinner");
await this.ensureMediaConfigFetched(matrixClient);
modal.close();
await Promise.race([this.ensureMediaConfigFetched(matrixClient), modal.finished]);
if (!this.mediaConfig) {
// User cancelled by clicking away on the spinner
return;
} else {
modal.close();
}
}

const tooBigFiles: File[] = [];
Expand Down

0 comments on commit d850c95

Please sign in to comment.