diff --git a/src/matrix/room/AttachmentUpload.js b/src/matrix/room/AttachmentUpload.js index 356bb5a7..013bf150 100644 --- a/src/matrix/room/AttachmentUpload.js +++ b/src/matrix/room/AttachmentUpload.js @@ -45,7 +45,9 @@ export class AttachmentUpload { if (this._status.get() === UploadStatus.Waiting) { this._upload(); } - await this._status.waitFor(s => s === UploadStatus.Error || s === UploadStatus.Uploaded).promise; + await this._status.waitFor(s => { + return s === UploadStatus.Error || s === UploadStatus.Uploaded; + }).promise; if (this._status.get() === UploadStatus.Error) { throw this._error; }