From 61c3613de05974f52aeeb6082e1c9d05fb81eb85 Mon Sep 17 00:00:00 2001 From: robertpin Date: Tue, 14 Sep 2021 11:15:03 +0300 Subject: [PATCH] Show reactions buttons at all times Don't send reactions via the channel if there's only one participant in the meeting --- .../components/native/ReactionMenu.js | 20 ++++++++----------- .../reactions/components/web/ReactionsMenu.js | 16 +++++---------- react/features/reactions/middleware.js | 6 +++++- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/react/features/reactions/components/native/ReactionMenu.js b/react/features/reactions/components/native/ReactionMenu.js index 91dc6bf61..f07bb40cb 100644 --- a/react/features/reactions/components/native/ReactionMenu.js +++ b/react/features/reactions/components/native/ReactionMenu.js @@ -5,7 +5,6 @@ import { View } from 'react-native'; import { useSelector } from 'react-redux'; import { ColorSchemeRegistry } from '../../../base/color-scheme'; -import { getParticipantCount } from '../../../base/participants'; import { REACTIONS } from '../../constants'; import RaiseHandButton from './RaiseHandButton'; @@ -37,20 +36,17 @@ function ReactionMenu({ overflowMenu }: Props) { const _styles = useSelector(state => ColorSchemeRegistry.get(state, 'Toolbox')); - const _participantCount = useSelector(state => getParticipantCount(state)); return ( - {_participantCount > 1 - && - {Object.keys(REACTIONS).map(key => ( - - ))} - - } + + {Object.keys(REACTIONS).map(key => ( + + ))} + ); diff --git a/react/features/reactions/components/web/ReactionsMenu.js b/react/features/reactions/components/web/ReactionsMenu.js index 5522a143a..1a7a6a38f 100644 --- a/react/features/reactions/components/web/ReactionsMenu.js +++ b/react/features/reactions/components/web/ReactionsMenu.js @@ -9,7 +9,7 @@ import { sendAnalytics } from '../../../analytics'; import { translate } from '../../../base/i18n'; -import { getLocalParticipant, getParticipantCount, participantUpdated } from '../../../base/participants'; +import { getLocalParticipant, participantUpdated } from '../../../base/participants'; import { connect } from '../../../base/redux'; import { dockToolbox } from '../../../toolbox/actions.web'; import { addReactionToBuffer } from '../../actions.any'; @@ -20,11 +20,6 @@ import ReactionButton from './ReactionButton'; type Props = { - /** - * The number of conference participants. - */ - _participantCount: number, - /** * Used for translation. */ @@ -182,13 +177,13 @@ class ReactionsMenu extends Component { * @inheritdoc */ render() { - const { _participantCount, _raisedHand, t, overflowMenu } = this.props; + const { _raisedHand, t, overflowMenu } = this.props; return (
- { _participantCount > 1 &&
+
{ this._getReactionButtons() } -
} +
next => action => { case FLUSH_REACTION_BUFFER: { const state = getState(); const { buffer } = state['features/reactions']; + const participantCount = getParticipantCount(state); batch(() => { - dispatch(sendReactions()); + if (participantCount > 1) { + dispatch(sendReactions()); + } dispatch(addReactionsToChat(getReactionMessageFromBuffer(buffer))); dispatch(pushReactions(buffer)); });