Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Comply w/ coding style

Lyubomir Marinov2ad869a036f0
diff --git a/android/settings.gradle b/android/settings.gradle
index 318023f815..ee5e51af42 100644
--- a/android/settings.gradle
+++ b/android/settings.gradle
@@ -1,8 +1,8 @@
rootProject.name = 'jitsi-meet-react'
-include ':react-native-immersive'
-project(':react-native-immersive').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-immersive/android')
include ':app'
+include ':react-native-immersive'
+project(':react-native-immersive').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-immersive/android')
include ':react-native-keep-awake'
project(':react-native-keep-awake').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keep-awake/android')
include ':react-native-vector-icons'
diff --git a/package.json b/package.json
index 027279a6fb..6f213de630 100644
--- a/package.json
+++ b/package.json
@@ -22,11 +22,11 @@
"bootstrap": "3.1.1",
"i18next": "3.4.4",
"i18next-xhr-backend": "1.1.0",
- "jQuery-Impromptu": "trentrichardson/jQuery-Impromptu#v6.0.0",
"jitsi-meet-logger": "jitsi/jitsi-meet-logger",
"jquery": "~2.1.1",
"jquery-contextmenu": "*",
"jquery-i18next": "1.1.0",
+ "jQuery-Impromptu": "trentrichardson/jQuery-Impromptu#v6.0.0",
"jquery-ui": "1.10.5",
"jssha": "1.5.0",
"jws": "*",
diff --git a/react/features/audio-mode/middleware.js b/react/features/audio-mode/middleware.js
index bce9efe582..c5790939bb 100644
--- a/react/features/audio-mode/middleware.js
+++ b/react/features/audio-mode/middleware.js
@@ -1,3 +1,5 @@
+/* @flow */
+
import { NativeModules } from 'react-native';
import { APP_WILL_MOUNT } from '../app';
@@ -49,7 +51,9 @@ MiddlewareRegistry.register(store => next => action => {
if (mode !== null) {
AudioMode.setMode(mode)
.catch(err =>
- console.error(`Failed to set audio mode ${mode}: ${err}`));
+ console.error(
+ `Failed to set audio mode ${String(mode)}: `
+ + `${err}`));
}
}
diff --git a/react/features/full-screen/middleware.js b/react/features/full-screen/middleware.js
index a29f4c1d0d..2c8e86d0db 100644
--- a/react/features/full-screen/middleware.js
+++ b/react/features/full-screen/middleware.js
@@ -1,3 +1,5 @@
+/* @flow */
+
import { StatusBar } from 'react-native';
import { Immersive } from 'react-native-immersive';
@@ -11,7 +13,7 @@ import { MiddlewareRegistry } from '../base/redux';
/**
* Middleware that captures conference actions and activates or deactivates the
- * full screen mode. On iOS it hides the status bar, and on Android it uses the
+ * full screen mode. On iOS it hides the status bar, and on Android it uses the
* immersive mode:
* https://developer.android.com/training/system-ui/immersive.html
* In immersive mode the status and navigation bars are hidden and thus the
@@ -21,31 +23,30 @@ import { MiddlewareRegistry } from '../base/redux';
* @returns {Function}
*/
MiddlewareRegistry.register(store => next => action => {
- let useFullScreen;
+ let fullScreen;
switch (action.type) {
case CONFERENCE_WILL_JOIN: {
- const state = store.getState()['features/base/conference'];
+ const conference = store.getState()['features/base/conference'];
- useFullScreen = !state.audioOnly;
+ fullScreen = !conference.audioOnly;
break;
}
case CONFERENCE_FAILED:
case CONFERENCE_LEFT:
- useFullScreen = false;
+ fullScreen = false;
break;
default:
- useFullScreen = null;
+ fullScreen = null;
break;
}
- if (useFullScreen !== null) {
- setFullScreen(useFullScreen)
- .catch(err => {
- console.warn(`Error setting full screen mode: ${err}`);
- });
+ if (fullScreen !== null) {
+ _setFullScreen(fullScreen)
+ .catch(err =>
+ console.warn(`Failed to set full screen mode: ${err}`));
}
return next(action);
@@ -53,24 +54,23 @@ MiddlewareRegistry.register(store => next => action => {
/**
* Activates/deactivates the full screen mode. On iOS it will hide the status
- * bar and On Android this will turn on immersive mode.
+ * bar, and on Android it will turn immersive mode on.
*
- * @param {boolean} enabled - True to set full screen mode, false to
+ * @param {boolean} fullScreen - True to set full screen mode, false to
* deactivate it.
+ * @private
* @returns {Promise}
*/
-function setFullScreen(enabled) {
- // XXX The Immersive module is only implemented on Android and throws on
- // other platforms.
+function _setFullScreen(fullScreen: boolean) {
+ // XXX The React Native module Immersive is only implemented on Android and
+ // throws on other platforms.
if (Platform.OS === 'android') {
- if (enabled) {
- return Immersive.on();
- }
-
- return Immersive.off();
+ return fullScreen ? Immersive.on() : Immersive.off();
}
- StatusBar.setHidden(enabled, 'slide');
+ // On platforms other than Android go with whatever React Native itself
+ // supports.
+ StatusBar.setHidden(fullScreen, 'slide');
return Promise.resolve();
}