Use cached value to read member count
This commit is contained in:
parent
34b8870a95
commit
e5bc5a933e
1 changed files with 3 additions and 1 deletions
|
@ -712,6 +712,8 @@ export default class MessagePanel extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
const callEventGrouper = this.callEventGroupers.get(mxEv.getContent().call_id);
|
const callEventGrouper = this.callEventGroupers.get(mxEv.getContent().call_id);
|
||||||
|
|
||||||
|
const isDirectMessage = this.props.room?.getJoinedMemberCount() <= 2;
|
||||||
|
|
||||||
// use txnId as key if available so that we don't remount during sending
|
// use txnId as key if available so that we don't remount during sending
|
||||||
ret.push(
|
ret.push(
|
||||||
<TileErrorBoundary key={mxEv.getTxnId() || eventId} mxEvent={mxEv}>
|
<TileErrorBoundary key={mxEv.getTxnId() || eventId} mxEvent={mxEv}>
|
||||||
|
@ -743,7 +745,7 @@ export default class MessagePanel extends React.Component<IProps, IState> {
|
||||||
enableFlair={this.props.enableFlair}
|
enableFlair={this.props.enableFlair}
|
||||||
showReadReceipts={this.props.showReadReceipts}
|
showReadReceipts={this.props.showReadReceipts}
|
||||||
callEventGrouper={callEventGrouper}
|
callEventGrouper={callEventGrouper}
|
||||||
hideSender={this.props.room?.getMembers().length <= 2 && this.props.layout === Layout.Bubble}
|
hideSender={isDirectMessage && this.props.layout === Layout.Bubble}
|
||||||
/>
|
/>
|
||||||
</TileErrorBoundary>,
|
</TileErrorBoundary>,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue