Browse Source

Show reactions buttons at all times

Don't send reactions via the channel if there's only one participant in the meeting
master
robertpin 4 years ago
parent
commit
61c3613de0

+ 8
- 12
react/features/reactions/components/native/ReactionMenu.js View File

5
 import { useSelector } from 'react-redux';
5
 import { useSelector } from 'react-redux';
6
 
6
 
7
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
7
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
8
-import { getParticipantCount } from '../../../base/participants';
9
 import { REACTIONS } from '../../constants';
8
 import { REACTIONS } from '../../constants';
10
 
9
 
11
 import RaiseHandButton from './RaiseHandButton';
10
 import RaiseHandButton from './RaiseHandButton';
37
     overflowMenu
36
     overflowMenu
38
 }: Props) {
37
 }: Props) {
39
     const _styles = useSelector(state => ColorSchemeRegistry.get(state, 'Toolbox'));
38
     const _styles = useSelector(state => ColorSchemeRegistry.get(state, 'Toolbox'));
40
-    const _participantCount = useSelector(state => getParticipantCount(state));
41
 
39
 
42
     return (
40
     return (
43
         <View style = { overflowMenu ? _styles.overflowReactionMenu : _styles.reactionMenu }>
41
         <View style = { overflowMenu ? _styles.overflowReactionMenu : _styles.reactionMenu }>
44
-            {_participantCount > 1
45
-                && <View style = { _styles.reactionRow }>
46
-                    {Object.keys(REACTIONS).map(key => (
47
-                        <ReactionButton
48
-                            key = { key }
49
-                            reaction = { key }
50
-                            styles = { _styles.reactionButton } />
51
-                    ))}
52
-                </View>
53
-            }
42
+            <View style = { _styles.reactionRow }>
43
+                {Object.keys(REACTIONS).map(key => (
44
+                    <ReactionButton
45
+                        key = { key }
46
+                        reaction = { key }
47
+                        styles = { _styles.reactionButton } />
48
+                ))}
49
+            </View>
54
             <RaiseHandButton onCancel = { onCancel } />
50
             <RaiseHandButton onCancel = { onCancel } />
55
         </View>
51
         </View>
56
     );
52
     );

+ 5
- 11
react/features/reactions/components/web/ReactionsMenu.js View File

9
     sendAnalytics
9
     sendAnalytics
10
 } from '../../../analytics';
10
 } from '../../../analytics';
11
 import { translate } from '../../../base/i18n';
11
 import { translate } from '../../../base/i18n';
12
-import { getLocalParticipant, getParticipantCount, participantUpdated } from '../../../base/participants';
12
+import { getLocalParticipant, participantUpdated } from '../../../base/participants';
13
 import { connect } from '../../../base/redux';
13
 import { connect } from '../../../base/redux';
14
 import { dockToolbox } from '../../../toolbox/actions.web';
14
 import { dockToolbox } from '../../../toolbox/actions.web';
15
 import { addReactionToBuffer } from '../../actions.any';
15
 import { addReactionToBuffer } from '../../actions.any';
20
 
20
 
21
 type Props = {
21
 type Props = {
22
 
22
 
23
-    /**
24
-     * The number of conference participants.
25
-     */
26
-    _participantCount: number,
27
-
28
     /**
23
     /**
29
      * Used for translation.
24
      * Used for translation.
30
      */
25
      */
182
      * @inheritdoc
177
      * @inheritdoc
183
      */
178
      */
184
     render() {
179
     render() {
185
-        const { _participantCount, _raisedHand, t, overflowMenu } = this.props;
180
+        const { _raisedHand, t, overflowMenu } = this.props;
186
 
181
 
187
         return (
182
         return (
188
             <div className = { `reactions-menu ${overflowMenu ? 'overflow' : ''}` }>
183
             <div className = { `reactions-menu ${overflowMenu ? 'overflow' : ''}` }>
189
-                { _participantCount > 1 && <div className = 'reactions-row'>
184
+                <div className = 'reactions-row'>
190
                     { this._getReactionButtons() }
185
                     { this._getReactionButtons() }
191
-                </div> }
186
+                </div>
192
                 <div className = 'raise-hand-row'>
187
                 <div className = 'raise-hand-row'>
193
                     <ReactionButton
188
                     <ReactionButton
194
                         accessibilityLabel = { t('toolbar.accessibilityLabel.raiseHand') }
189
                         accessibilityLabel = { t('toolbar.accessibilityLabel.raiseHand') }
217
 
212
 
218
     return {
213
     return {
219
         _localParticipantID: localParticipant.id,
214
         _localParticipantID: localParticipant.id,
220
-        _raisedHand: localParticipant.raisedHand,
221
-        _participantCount: getParticipantCount(state)
215
+        _raisedHand: localParticipant.raisedHand
222
     };
216
     };
223
 }
217
 }
224
 
218
 

+ 5
- 1
react/features/reactions/middleware.js View File

3
 import { batch } from 'react-redux';
3
 import { batch } from 'react-redux';
4
 
4
 
5
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
5
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
6
+import { getParticipantCount } from '../base/participants';
6
 import { MiddlewareRegistry } from '../base/redux';
7
 import { MiddlewareRegistry } from '../base/redux';
7
 import { updateSettings } from '../base/settings';
8
 import { updateSettings } from '../base/settings';
8
 import { playSound, registerSound, unregisterSound } from '../base/sounds';
9
 import { playSound, registerSound, unregisterSound } from '../base/sounds';
91
     case FLUSH_REACTION_BUFFER: {
92
     case FLUSH_REACTION_BUFFER: {
92
         const state = getState();
93
         const state = getState();
93
         const { buffer } = state['features/reactions'];
94
         const { buffer } = state['features/reactions'];
95
+        const participantCount = getParticipantCount(state);
94
 
96
 
95
         batch(() => {
97
         batch(() => {
96
-            dispatch(sendReactions());
98
+            if (participantCount > 1) {
99
+                dispatch(sendReactions());
100
+            }
97
             dispatch(addReactionsToChat(getReactionMessageFromBuffer(buffer)));
101
             dispatch(addReactionsToChat(getReactionMessageFromBuffer(buffer)));
98
             dispatch(pushReactions(buffer));
102
             dispatch(pushReactions(buffer));
99
         });
103
         });

Loading…
Cancel
Save