forked from mystiq/hydrogen-web
handle upload failures better
This commit is contained in:
parent
d477be2b41
commit
8b16d8bc99
2 changed files with 8 additions and 2 deletions
|
@ -25,7 +25,7 @@ export class FileTile extends MessageTile {
|
|||
this._downloading = false;
|
||||
if (this._isUploading) {
|
||||
// should really do this with an ObservableValue and waitFor to prevent leaks when the promise never resolves
|
||||
this._entry.attachment.uploaded().then(() => {
|
||||
this._entry.attachment.uploaded().finally(() => {
|
||||
if (!this.isDisposed) {
|
||||
this.emitChange("label");
|
||||
}
|
||||
|
|
|
@ -53,7 +53,13 @@ export class SendQueue {
|
|||
}
|
||||
if (pendingEvent.attachment) {
|
||||
const {attachment} = pendingEvent;
|
||||
try {
|
||||
await attachment.uploaded();
|
||||
} catch (err) {
|
||||
console.log("upload failed, skip sending message", pendingEvent);
|
||||
this._amountSent += 1;
|
||||
continue;
|
||||
}
|
||||
attachment.applyToContent(pendingEvent.content);
|
||||
}
|
||||
if (pendingEvent.needsEncryption) {
|
||||
|
|
Loading…
Reference in a new issue