mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +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 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() {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user