Browse Source

misc: fix dispatching actions twice when mapDispatchToProps is used

The functions need not return anything, or it will be dispatched as another
action.
j8
Saúl Ibarra Corretgé 8 years ago
parent
commit
0bf9a78e4c

+ 3
- 3
react/features/conference/components/Conference.native.js View File

@@ -228,7 +228,7 @@ function _mapDispatchToProps(dispatch) {
228 228
          * @private
229 229
          */
230 230
         _onConnect() {
231
-            return dispatch(connect());
231
+            dispatch(connect());
232 232
         },
233 233
 
234 234
         /**
@@ -238,7 +238,7 @@ function _mapDispatchToProps(dispatch) {
238 238
          * @private
239 239
          */
240 240
         _onDisconnect() {
241
-            return dispatch(disconnect());
241
+            dispatch(disconnect());
242 242
         },
243 243
 
244 244
         /**
@@ -250,7 +250,7 @@ function _mapDispatchToProps(dispatch) {
250 250
          * @private
251 251
          */
252 252
         _setToolboxVisible(visible: boolean) {
253
-            return dispatch(setToolboxVisible(visible));
253
+            dispatch(setToolboxVisible(visible));
254 254
         }
255 255
     };
256 256
 }

+ 1
- 1
react/features/overlay/components/ReloadButton.js View File

@@ -79,7 +79,7 @@ function _mapDispatchToProps(dispatch: Function): Object {
79 79
          * @returns {Object} Dispatched action.
80 80
          */
81 81
         _reloadNow() {
82
-            return dispatch(_reloadNow());
82
+            dispatch(_reloadNow());
83 83
         }
84 84
     };
85 85
 }

+ 1
- 1
react/features/toolbox/components/SecondaryToolbar.web.js View File

@@ -121,7 +121,7 @@ function _mapDispatchToProps(dispatch: Function): Object {
121 121
          * @returns {Object} Dispatched action.
122 122
          */
123 123
         _onSideToolbarContainerToggled(containerId: string) {
124
-            return dispatch(toggleSideToolbarContainer(containerId));
124
+            dispatch(toggleSideToolbarContainer(containerId));
125 125
         }
126 126
     };
127 127
 }

+ 4
- 4
react/features/toolbox/components/Toolbox.native.js View File

@@ -268,7 +268,7 @@ function _mapDispatchToProps(dispatch) {
268 268
          * @type {Function}
269 269
          */
270 270
         _onRoomLock() {
271
-            return dispatch(beginRoomLockRequest());
271
+            dispatch(beginRoomLockRequest());
272 272
         },
273 273
 
274 274
         /**
@@ -279,7 +279,7 @@ function _mapDispatchToProps(dispatch) {
279 279
          * @type {Function}
280 280
          */
281 281
         _onShareRoom() {
282
-            return dispatch(beginShareRoom());
282
+            dispatch(beginShareRoom());
283 283
         },
284 284
 
285 285
         /**
@@ -290,7 +290,7 @@ function _mapDispatchToProps(dispatch) {
290 290
          * @type {Function}
291 291
          */
292 292
         _onToggleAudioOnly() {
293
-            return dispatch(toggleAudioOnly());
293
+            dispatch(toggleAudioOnly());
294 294
         },
295 295
 
296 296
         /**
@@ -302,7 +302,7 @@ function _mapDispatchToProps(dispatch) {
302 302
          * @type {Function}
303 303
          */
304 304
         _onToggleCameraFacingMode() {
305
-            return dispatch(toggleCameraFacingMode());
305
+            dispatch(toggleCameraFacingMode());
306 306
         }
307 307
     };
308 308
 }

+ 3
- 3
react/features/toolbox/functions.native.js View File

@@ -31,7 +31,7 @@ export function abstractMapDispatchToProps(dispatch: Dispatch<*>): Object {
31 31
             // business to know that anyway. The undefined value is our
32 32
             // expression of (1) the lack of knowledge & (2) the desire to no
33 33
             // longer have a valid room name to join.
34
-            return dispatch(appNavigate(undefined));
34
+            dispatch(appNavigate(undefined));
35 35
         },
36 36
 
37 37
         /**
@@ -43,7 +43,7 @@ export function abstractMapDispatchToProps(dispatch: Dispatch<*>): Object {
43 43
          * @type {Function}
44 44
          */
45 45
         _onToggleAudio() {
46
-            return dispatch(toggleAudioMuted());
46
+            dispatch(toggleAudioMuted());
47 47
         },
48 48
 
49 49
         /**
@@ -54,7 +54,7 @@ export function abstractMapDispatchToProps(dispatch: Dispatch<*>): Object {
54 54
          * @type {Function}
55 55
          */
56 56
         _onToggleVideo() {
57
-            return dispatch(toggleVideoMuted());
57
+            dispatch(toggleVideoMuted());
58 58
         }
59 59
     };
60 60
 }

Loading…
Cancel
Save