length -> duration

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-08-06 14:38:53 +02:00
parent 43325eb866
commit 8368aa13ca
No known key found for this signature in database
GPG Key ID: CC823428E9B582FB
2 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ export default class CallEventGrouper extends EventEmitter {
return Boolean(this.reject);
}
public get length(): Date {
public get duration(): Date {
if (!this.hangup || !this.selectAnswer) return;
return new Date(this.hangup.getDate().getTime() - this.selectAnswer.getDate().getTime());
}

View File

@ -132,10 +132,10 @@ export default class CallEvent extends React.Component<IProps, IState> {
// https://github.com/vector-im/riot-android/issues/2623
// Also the correct hangup code as of VoIP v1 (with underscore)
// Also, if we don't have a reason
const length = this.props.callEventGrouper.length;
const duration = this.props.callEventGrouper.duration;
let text = _t("Call ended");
if (length) {
text += " • " + formatCallTime(length);
if (duration) {
text += " • " + formatCallTime(duration);
}
return (
<div className="mx_CallEvent_content">