mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
make safe to call when no attachments present
This commit is contained in:
parent
fba5877b3b
commit
a23075a326
@ -85,11 +85,11 @@ export class PendingEvent {
|
|||||||
get error() { return this._error; }
|
get error() { return this._error; }
|
||||||
|
|
||||||
get attachmentsTotalBytes() {
|
get attachmentsTotalBytes() {
|
||||||
return Object.values(this._attachments).reduce((t, a) => t + a.size, 0);
|
return this._attachments && Object.values(this._attachments).reduce((t, a) => t + a.size, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
get attachmentsSentBytes() {
|
get attachmentsSentBytes() {
|
||||||
return Object.values(this._attachments).reduce((t, a) => t + a.sentBytes, 0);
|
return this._attachments && Object.values(this._attachments).reduce((t, a) => t + a.sentBytes, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
async uploadAttachments(hsApi) {
|
async uploadAttachments(hsApi) {
|
||||||
|
Loading…
Reference in New Issue
Block a user