From 2587eefefc89a735d4986c9de5480cf9d7991651 Mon Sep 17 00:00:00 2001 From: "titus.moldovan" Date: Fri, 12 Mar 2021 09:34:31 +0200 Subject: [PATCH] fix(chat) hides send private chat button when enable.chat flag is false. --- react/features/chat/components/PrivateMessageButton.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/react/features/chat/components/PrivateMessageButton.js b/react/features/chat/components/PrivateMessageButton.js index f81d09b5b..9d2f482f2 100644 --- a/react/features/chat/components/PrivateMessageButton.js +++ b/react/features/chat/components/PrivateMessageButton.js @@ -1,5 +1,6 @@ // @flow +import { CHAT_ENABLED, getFeatureFlag } from '../../base/flags'; import { translate } from '../../base/i18n'; import { IconMessage, IconReply } from '../../base/icons'; import { getParticipantById } from '../../base/participants'; @@ -77,8 +78,12 @@ class PrivateMessageButton extends AbstractButton { * @returns {Props} */ export function _mapStateToProps(state: Object, ownProps: Props): $Shape { + const enabled = getFeatureFlag(state, CHAT_ENABLED, true); + const { visible = enabled } = ownProps; + return { - _participant: getParticipantById(state, ownProps.participantID) + _participant: getParticipantById(state, ownProps.participantID), + visible }; }