You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-19 05:22:13 +03:00
Disable 'Start New Chat' button in MemberInfo if we already have chats
Part of https://github.com/vector-im/riot-web/issues/10416
This commit is contained in:
@@ -789,6 +789,7 @@ module.exports = React.createClass({
|
||||
let spinner;
|
||||
|
||||
if (this.props.member.userId !== this.context.matrixClient.credentials.userId) {
|
||||
// TODO: Immutable DMs replaces a lot of this
|
||||
const dmRoomMap = new DMRoomMap(this.context.matrixClient);
|
||||
// dmRooms will not include dmRooms that we have been invited into but did not join.
|
||||
// Because DMRoomMap runs off account_data[m.direct] which is only set on join of dm room.
|
||||
@@ -830,7 +831,7 @@ module.exports = React.createClass({
|
||||
mx_MemberInfo_createRoom_label: true,
|
||||
mx_RoomTile_name: true,
|
||||
});
|
||||
const startNewChat = <AccessibleButton
|
||||
let startNewChat = <AccessibleButton
|
||||
className="mx_MemberInfo_createRoom"
|
||||
onClick={this.onNewDMClick}
|
||||
>
|
||||
@@ -840,6 +841,8 @@ module.exports = React.createClass({
|
||||
<div className={labelClasses}><i>{ _t("Start a chat") }</i></div>
|
||||
</AccessibleButton>;
|
||||
|
||||
if (tiles.length > 0) startNewChat = null; // Don't offer a button for a new chat if we have one.
|
||||
|
||||
startChat = <div>
|
||||
<h3>{ _t("Direct chats") }</h3>
|
||||
{ tiles }
|
||||
|
||||
Reference in New Issue
Block a user