From 0bbcd3181cc648404bd457cdd4f9a1fe89386e22 Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Tue, 13 Feb 2018 13:14:06 -0600 Subject: [PATCH] [RN] Adjust Conference for the reduced UI mode (Coding style) --- .../conference/components/Conference.native.js | 11 +++++++---- react/features/conference/index.js | 3 +-- react/features/conference/middleware.js | 9 +++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/react/features/conference/components/Conference.native.js b/react/features/conference/components/Conference.native.js index 21d9ad297..fbca9eaef 100644 --- a/react/features/conference/components/Conference.native.js +++ b/react/features/conference/components/Conference.native.js @@ -67,7 +67,8 @@ type Props = { _onHardwareBackPress: Function, /** - * The indicator which determines if we are in reduced UI mode. + * The indicator which determines whether the UI is reduced (to accommodate + * smaller display areas). * * @private */ @@ -200,7 +201,7 @@ class Conference extends Component { {/* * If there is a ringing call, show the callee's info. */ - !this.props._reducedUI && + this.props._reducedUI || } {/* @@ -232,7 +233,7 @@ class Conference extends Component { {/* * The dialogs are in the topmost stacking layers. */ - !this.props._reducedUI && + this.props._reducedUI || } ); @@ -370,6 +371,7 @@ function _mapDispatchToProps(dispatch) { * @private * @returns {{ * _connecting: boolean, + * _reducedUI: boolean, * _toolboxVisible: boolean * }} */ @@ -403,7 +405,8 @@ function _mapStateToProps(state) { _connecting: Boolean(connecting_), /** - * The indicator which determines if we are in reduced UI mode. + * The indicator which determines whether the UI is reduced (to + * accommodate smaller display areas). * * @private * @type {boolean} diff --git a/react/features/conference/index.js b/react/features/conference/index.js index 406ed9037..7115963a1 100644 --- a/react/features/conference/index.js +++ b/react/features/conference/index.js @@ -1,5 +1,4 @@ -import './route'; - export * from './components'; import './middleware'; +import './route'; diff --git a/react/features/conference/middleware.js b/react/features/conference/middleware.js index 6cda7d2be..f21e70fc0 100644 --- a/react/features/conference/middleware.js +++ b/react/features/conference/middleware.js @@ -10,12 +10,13 @@ import { MiddlewareRegistry } from '../base/redux'; import { setFilmstripEnabled } from '../filmstrip'; import { setToolboxEnabled } from '../toolbox'; -MiddlewareRegistry.register(({ dispatch, getState }) => next => action => { +MiddlewareRegistry.register(store => next => action => { const result = next(action); switch (action.type) { case CONFERENCE_JOINED: case SET_REDUCED_UI: { + const { dispatch, getState } = store; const state = getState(); const { audioOnly } = state['features/base/conference']; const { reducedUI } = state['features/base/responsive-ui']; @@ -25,12 +26,12 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => { // XXX: Currently setting the received video quality will disable // audio-only mode if engaged, that's why we check for it here. - if (!audioOnly) { - dispatch(setReceiveVideoQuality( + audioOnly + || dispatch( + setReceiveVideoQuality( reducedUI ? VIDEO_QUALITY_LEVELS.LOW : VIDEO_QUALITY_LEVELS.HIGH)); - } break; }