Refactoring and fixes

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-06-02 10:18:32 +02:00
parent 3bf28e3a6b
commit 521b2445a8
No known key found for this signature in database
GPG key ID: 9760693FDD98A790
2 changed files with 36 additions and 42 deletions

View file

@ -43,7 +43,7 @@ export default class CallEvent extends React.Component<IProps, IState> {
super(props);
this.state = {
callState: this.props.callEventGrouper.getState(),
callState: this.props.callEventGrouper.state,
}
}
@ -77,7 +77,7 @@ export default class CallEvent extends React.Component<IProps, IState> {
);
}
if (state === CallState.Ended) {
const hangupReason = this.props.callEventGrouper.getHangupReason();
const hangupReason = this.props.callEventGrouper.hangupReason;
if (["user_hangup", "user hangup"].includes(hangupReason) || !hangupReason) {
// workaround for https://github.com/vector-im/element-web/issues/5178
@ -157,7 +157,7 @@ export default class CallEvent extends React.Component<IProps, IState> {
render() {
const event = this.props.mxEvent;
const sender = event.sender ? event.sender.name : event.getSender();
const callType = this.props.callEventGrouper.isVoice() ? _t("Voice call") : _t("Video call");
const callType = this.props.callEventGrouper.isVoice ? _t("Voice call") : _t("Video call");
const content = this.renderContent(this.state.callState);
return (