From db59b450763ec45bdce5299d4d0630b729784fa2 Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Wed, 17 May 2017 16:41:52 -0500 Subject: [PATCH 1/2] Upgrade NPM dependencies/packages --- package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 585f54708..cec81dba7 100644 --- a/package.json +++ b/package.json @@ -29,12 +29,12 @@ "bootstrap": "3.1.1", "es6-iterator": "2.0.1", "es6-symbol": "3.1.1", - "i18next": "8.0.0", + "i18next": "8.2.1", "i18next-browser-languagedetector": "1.0.1", "i18next-xhr-backend": "1.4.1", "jitsi-meet-logger": "jitsi/jitsi-meet-logger", "jquery": "2.1.4", - "jquery-contextmenu": "2.4.3", + "jquery-contextmenu": "2.4.5", "jquery-i18next": "1.2.0", "jQuery-Impromptu": "trentrichardson/jQuery-Impromptu#v6.0.0", "jquery-ui": "1.10.5", @@ -45,14 +45,14 @@ "postis": "2.2.0", "react": "15.4.2", "react-dom": "15.4.2", - "react-i18next": "3.1.0", + "react-i18next": "4.1.0", "react-native": "0.42.3", - "react-native-background-timer": "1.0.0", - "react-native-immersive": "0.0.4", - "react-native-keep-awake": "2.0.3", + "react-native-background-timer": "1.0.1", + "react-native-immersive": "0.0.5", + "react-native-keep-awake": "2.0.4", "react-native-locale-detector": "1.0.1", "react-native-prompt": "1.0.0", - "react-native-vector-icons": "4.0.1", + "react-native-vector-icons": "4.1.1", "react-native-webrtc": "jitsi/react-native-webrtc", "react-redux": "5.0.4", "redux": "3.6.0", @@ -74,11 +74,11 @@ "babel-preset-react": "6.24.1", "babel-preset-stage-1": "6.24.1", "clean-css": "3.4.25", - "css-loader": "0.28.0", + "css-loader": "0.28.1", "eslint": "3.19.0", "eslint-plugin-flowtype": "2.30.4", "eslint-plugin-import": "2.2.0", - "eslint-plugin-jsdoc": "3.0.2", + "eslint-plugin-jsdoc": "3.1.0", "eslint-plugin-react": "6.10.3", "eslint-plugin-react-native": "2.3.2", "expose-loader": "0.7.3", @@ -91,7 +91,7 @@ "node-sass": "3.13.1", "precommit-hook": "3.0.0", "string-replace-loader": "1.2.0", - "style-loader": "0.16.1", + "style-loader": "0.17.0", "webpack": "1.14.0", "webpack-dev-server": "1.16.3" }, From 3c31a60b3277d45cab48bff810c85520e53aed74 Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Wed, 17 May 2017 16:44:28 -0500 Subject: [PATCH 2/2] Fix TypeError: Cannot read property 'isGuest' of undefined --- react/features/base/config/reducer.js | 7 +++++ react/features/base/lib-jitsi-meet/actions.js | 8 +---- .../base/lib-jitsi-meet/middleware.js | 31 ++++++++++--------- react/features/base/react/Platform.web.js | 2 +- react/features/toolbox/actions.web.js | 27 ++++++---------- 5 files changed, 34 insertions(+), 41 deletions(-) diff --git a/react/features/base/config/reducer.js b/react/features/base/config/reducer.js index 15877b0eb..5c1ad5b63 100644 --- a/react/features/base/config/reducer.js +++ b/react/features/base/config/reducer.js @@ -58,6 +58,13 @@ function _setConfig(state, action) { // The config of INITIAL_STATE is meant to override the config // downloaded from the Jitsi Meet deployment because the former contains // values that are mandatory. + // + // FIXME At the time of this writing the hard-coded overriding values + // are specific to mobile/React Native but the source code here is + // executed on Web/React as well. The latter is not a practical problem + // right now because the rest of the Web/React source code does not read + // the overridden properties/values, it still relies on the global + // variable config. ...INITIAL_STATE }; } diff --git a/react/features/base/lib-jitsi-meet/actions.js b/react/features/base/lib-jitsi-meet/actions.js index e6d4eddc8..97bda7fb1 100644 --- a/react/features/base/lib-jitsi-meet/actions.js +++ b/react/features/base/lib-jitsi-meet/actions.js @@ -21,15 +21,9 @@ export function disposeLib() { return (dispatch: Dispatch<*>) => { dispatch({ type: LIB_WILL_DISPOSE }); - // XXX We're wrapping it with Promise because: - // a) to be better aligned with initLib() method which is async; - // b) as currently there is no implementation for it in lib-jitsi-meet - // and there is a big chance it will be async. // TODO Currently, lib-jitsi-meet doesn't have the functionality to // dispose itself. - return ( - Promise.resolve() - .then(() => dispatch({ type: LIB_DID_DISPOSE }))); + dispatch({ type: LIB_DID_DISPOSE }); }; } diff --git a/react/features/base/lib-jitsi-meet/middleware.js b/react/features/base/lib-jitsi-meet/middleware.js index deb6c9cd2..f6f0b5b08 100644 --- a/react/features/base/lib-jitsi-meet/middleware.js +++ b/react/features/base/lib-jitsi-meet/middleware.js @@ -99,22 +99,23 @@ function _setConfig({ dispatch, getState }, next, action) { // disposed of first. // TODO Currently, disposeLib actually does not dispose of lib-jitsi-meet // because lib-jitsi-meet does not implement such functionality. - const disposeLibPromise - = initialized ? dispatch(disposeLib()) : Promise.resolve(); + if (initialized) { + dispatch(disposeLib()); + } - disposeLibPromise.then(() => { - // Let the new config into the Redux store (because initLib will read it - // from there). - next(action); + // Let the new config into the Redux store (because initLib will read it + // from there). + const result = next(action); - // FIXME Obviously, the following is bad design. However, I'm currently - // introducing the features base/config and base/logging and I'm trying - // to minimize the scope of the changes while I'm attempting to preserve - // compatibility with the existing partially React-ified Web source code - // and what was already executing on React Native. Additionally, I do - // not care to load logging_config.js on React Native. - dispatch(setLoggingConfig(window.loggingConfig)); + // FIXME Obviously, the following is bad design. However, I'm currently + // introducing the features base/config and base/logging and I'm trying to + // minimize the scope of the changes while I'm attempting to preserve + // compatibility with the existing partially React-ified Web source code and + // what was already executing on React Native. Additionally, I do not care + // to load logging_config.js on React Native. + dispatch(setLoggingConfig(window.loggingConfig)); - dispatch(initLib()); - }); + dispatch(initLib()); + + return result; } diff --git a/react/features/base/react/Platform.web.js b/react/features/base/react/Platform.web.js index 7066dfb01..b02cd17e2 100644 --- a/react/features/base/react/Platform.web.js +++ b/react/features/base/react/Platform.web.js @@ -1,6 +1,6 @@ /* @flow */ -const userAgent = navigator.userAgent; +const { userAgent } = navigator; let OS; if (userAgent.match(/Android/i)) { diff --git a/react/features/toolbox/actions.web.js b/react/features/toolbox/actions.web.js index fbf7608a8..9396f1949 100644 --- a/react/features/toolbox/actions.web.js +++ b/react/features/toolbox/actions.web.js @@ -172,9 +172,8 @@ export function showDesktopSharingButton(): Function { export function showDialPadButton(show: boolean): Function { return (dispatch: Dispatch<*>) => { const buttonName = 'dialpad'; - const shouldShow = UIUtil.isButtonEnabled(buttonName) && show; - if (shouldShow) { + if (show && UIUtil.isButtonEnabled(buttonName)) { dispatch(setToolbarButton(buttonName, { hidden: false })); @@ -205,11 +204,9 @@ export function showRecordingButton(): Function { export function showSharedVideoButton(): Function { return (dispatch: Dispatch<*>) => { const buttonName = 'sharedvideo'; - const shouldShow - = UIUtil.isButtonEnabled(buttonName) - && !config.disableThirdPartyRequests; - if (shouldShow) { + if (UIUtil.isButtonEnabled(buttonName) + && !config.disableThirdPartyRequests) { dispatch(setToolbarButton(buttonName, { hidden: false })); @@ -218,28 +215,22 @@ export function showSharedVideoButton(): Function { } /** - * Shows SIP call button if it's required and appropriate - * flag is passed. + * Shows SIP call button if it's required and appropriate flag is passed. * * @param {boolean} show - Flag showing whether to show button or not. * @returns {Function} */ export function showSIPCallButton(show: boolean): Function { - return (dispatch: Dispatch<*>) => { + return (dispatch: Dispatch<*>, getState: Function) => { const buttonName = 'sip'; - // hide the button if there is a config to check for user roles, - // based on the token and the the user is guest - const shouldShow - = APP.conference.sipGatewayEnabled() + if (show + && APP.conference.sipGatewayEnabled() && UIUtil.isButtonEnabled(buttonName) - && show && (!config.enableUserRolesBasedOnToken - || !APP.tokenData.isGuest); - - if (shouldShow) { + || !getState()['features/jwt'].isGuest)) { dispatch(setToolbarButton(buttonName, { - hidden: !shouldShow + hidden: false })); } };