mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
handle upload failures better
This commit is contained in:
parent
d477be2b41
commit
8b16d8bc99
@ -25,7 +25,7 @@ export class FileTile extends MessageTile {
|
|||||||
this._downloading = false;
|
this._downloading = false;
|
||||||
if (this._isUploading) {
|
if (this._isUploading) {
|
||||||
// should really do this with an ObservableValue and waitFor to prevent leaks when the promise never resolves
|
// 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) {
|
if (!this.isDisposed) {
|
||||||
this.emitChange("label");
|
this.emitChange("label");
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,13 @@ export class SendQueue {
|
|||||||
}
|
}
|
||||||
if (pendingEvent.attachment) {
|
if (pendingEvent.attachment) {
|
||||||
const {attachment} = pendingEvent;
|
const {attachment} = pendingEvent;
|
||||||
await attachment.uploaded();
|
try {
|
||||||
|
await attachment.uploaded();
|
||||||
|
} catch (err) {
|
||||||
|
console.log("upload failed, skip sending message", pendingEvent);
|
||||||
|
this._amountSent += 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
attachment.applyToContent(pendingEvent.content);
|
attachment.applyToContent(pendingEvent.content);
|
||||||
}
|
}
|
||||||
if (pendingEvent.needsEncryption) {
|
if (pendingEvent.needsEncryption) {
|
||||||
|
Loading…
Reference in New Issue
Block a user