mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
basic reporting of image upload progress in %
This commit is contained in:
parent
6bd777e7be
commit
671e23a123
@ -36,6 +36,9 @@ export class ImageTile extends MessageTile {
|
|||||||
this.track(this._entry.attachments.url.status.subscribe(() => {
|
this.track(this._entry.attachments.url.status.subscribe(() => {
|
||||||
this.emitChange("uploadStatus");
|
this.emitChange("uploadStatus");
|
||||||
}));
|
}));
|
||||||
|
this.track(this._entry.attachments.url.uploadProgress.subscribe(() => {
|
||||||
|
this.emitChange("uploadStatus");
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +78,8 @@ export class ImageTile extends MessageTile {
|
|||||||
|
|
||||||
get uploadStatus() {
|
get uploadStatus() {
|
||||||
if (this._entry.attachments) {
|
if (this._entry.attachments) {
|
||||||
return this._entry.attachments.url.status.get();
|
const attachment = this._entry.attachments.url;
|
||||||
|
return `${attachment.status.get()} (${Math.round(attachment.uploadProgress.get() * 100)}%)`;
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user