Quellcode durchsuchen

Show reactions buttons at all times

Don't send reactions via the channel if there's only one participant in the meeting
master
robertpin vor 4 Jahren
Ursprung
Commit
61c3613de0

+ 8
- 12
react/features/reactions/components/native/ReactionMenu.js Datei anzeigen

@@ -5,7 +5,6 @@ import { View } from 'react-native';
5 5
 import { useSelector } from 'react-redux';
6 6
 
7 7
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
8
-import { getParticipantCount } from '../../../base/participants';
9 8
 import { REACTIONS } from '../../constants';
10 9
 
11 10
 import RaiseHandButton from './RaiseHandButton';
@@ -37,20 +36,17 @@ function ReactionMenu({
37 36
     overflowMenu
38 37
 }: Props) {
39 38
     const _styles = useSelector(state => ColorSchemeRegistry.get(state, 'Toolbox'));
40
-    const _participantCount = useSelector(state => getParticipantCount(state));
41 39
 
42 40
     return (
43 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 50
             <RaiseHandButton onCancel = { onCancel } />
55 51
         </View>
56 52
     );

+ 5
- 11
react/features/reactions/components/web/ReactionsMenu.js Datei anzeigen

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

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

Laden…
Abbrechen
Speichern