Skip to content

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

feat(flow): tame the beast

Saúl Ibarra Corretgé7162080d0046
diff --git a/react/features/base/conference/reducer.js b/react/features/base/conference/reducer.js
index f220f701fc..43ac2df34f 100644
--- a/react/features/base/conference/reducer.js
+++ b/react/features/base/conference/reducer.js
@@ -28,8 +28,13 @@ import { VIDEO_QUALITY_LEVELS } from './constants';
import { isRoomValid } from './functions';
const DEFAULT_STATE = {
+ conference: undefined,
joining: undefined,
+ leaving: undefined,
+ locked: undefined,
maxReceiverVideoQuality: VIDEO_QUALITY_LEVELS.HIGH,
+ password: undefined,
+ passwordRequired: undefined,
preferredReceiverVideoQuality: VIDEO_QUALITY_LEVELS.HIGH
};
diff --git a/react/features/base/i18n/i18next.js b/react/features/base/i18n/i18next.js
index 6e9d9b6bdf..919e202735 100644
--- a/react/features/base/i18n/i18next.js
+++ b/react/features/base/i18n/i18next.js
@@ -18,7 +18,7 @@ declare var interfaceConfig: Object;
* @public
* @type {Array<string>}
*/
-export const LANGUAGES = Object.keys(LANGUAGES_RESOURCES);
+export const LANGUAGES: Array<string> = Object.keys(LANGUAGES_RESOURCES);
/**
* The default language.
diff --git a/react/features/base/react/components/AbstractContainer.js b/react/features/base/react/components/AbstractContainer.js
index 14f90663d9..7d0bdade73 100644
--- a/react/features/base/react/components/AbstractContainer.js
+++ b/react/features/base/react/components/AbstractContainer.js
@@ -95,6 +95,7 @@ export default class AbstractContainer<P: Props> extends Component<P> {
...filteredProps
} = props || this.props;
+ // $FlowFixMe
return React.createElement(type, filteredProps, children);
}
}
diff --git a/react/features/base/react/components/native/Container.js b/react/features/base/react/components/native/Container.js
index 95c7c20802..08a218cc9d 100644
--- a/react/features/base/react/components/native/Container.js
+++ b/react/features/base/react/components/native/Container.js
@@ -58,7 +58,7 @@ export default class Container<P: Props> extends AbstractContainer<P> {
accessibilityLabel,
accessible,
onPress: onClick,
- underlayColor
+ ...touchFeedback && { underlayColor }
},
element);
}
diff --git a/react/features/calendar-sync/reducer.js b/react/features/calendar-sync/reducer.js
index 0e1918389e..144500c397 100644
--- a/react/features/calendar-sync/reducer.js
+++ b/react/features/calendar-sync/reducer.js
@@ -62,6 +62,7 @@ isCalendarEnabled()
// knownDomains. At this point, it should have already been
// translated into the new state format (namely, base/known-domains)
// and the app no longer needs it.
+ // $FlowFixMe
if (typeof state.knownDomains !== 'undefined') {
return set(state, 'knownDomains', undefined);
}
diff --git a/react/features/mobile/audio-mode/components/AudioRouteButton.js b/react/features/mobile/audio-mode/components/AudioRouteButton.js
index 44768454e8..0d1c75f900 100644
--- a/react/features/mobile/audio-mode/components/AudioRouteButton.js
+++ b/react/features/mobile/audio-mode/components/AudioRouteButton.js
@@ -22,7 +22,7 @@ import AudioRoutePickerDialog from './AudioRoutePickerDialog';
*/
const MPVolumeView
= NativeModules.MPVolumeViewManager
- && requireNativeComponent('MPVolumeView', null);
+ && requireNativeComponent('MPVolumeView');
/**
* The style required to hide the {@code MPVolumeView}, since it's displayed
diff --git a/react/features/recording/components/LiveStream/StreamKeyForm.web.js b/react/features/recording/components/LiveStream/StreamKeyForm.web.js
index e88b906c9a..97c0cac0a4 100644
--- a/react/features/recording/components/LiveStream/StreamKeyForm.web.js
+++ b/react/features/recording/components/LiveStream/StreamKeyForm.web.js
@@ -52,7 +52,7 @@ class StreamKeyForm extends AbstractStreamKeyForm {
shouldFitContainer = { true }
type = 'text'
value = { this.state.value } />
- { this.props.helpURL
+ { this.helpURL
? <div className = 'form-footer'>
<a
className = 'helper-link'
diff --git a/react/features/settings/functions.js b/react/features/settings/functions.js
index 317d114965..6d0a688562 100644
--- a/react/features/settings/functions.js
+++ b/react/features/settings/functions.js
@@ -34,7 +34,8 @@ export function normalizeUserInputURL(url: string) {
const urlRegExp = new RegExp('^(\\w+://)?(.+)$');
const urlComponents = urlRegExp.exec(url);
- if (!urlComponents[1] || !urlComponents[1].startsWith('http')) {
+ if (urlComponents && (!urlComponents[1]
+ || !urlComponents[1].startsWith('http'))) {
url = `https://${urlComponents[2]}`;
}
diff --git a/react/features/toolbox/middleware.js b/react/features/toolbox/middleware.js
index 160f74ebe3..2f38565324 100644
--- a/react/features/toolbox/middleware.js
+++ b/react/features/toolbox/middleware.js
@@ -62,9 +62,6 @@ function _setFullScreen(next, action) {
if (typeof documentElement.requestFullscreen === 'function') {
documentElement.requestFullscreen();
- } else if (
- typeof documentElement.msRequestFullscreen === 'function') {
- documentElement.msRequestFullscreen();
} else if (
typeof documentElement.mozRequestFullScreen === 'function') {
documentElement.mozRequestFullScreen();
@@ -72,14 +69,23 @@ function _setFullScreen(next, action) {
typeof documentElement.webkitRequestFullscreen === 'function') {
documentElement.webkitRequestFullscreen();
}
- } else if (typeof document.exitFullscreen === 'function') {
- document.exitFullscreen();
- } else if (typeof document.msExitFullscreen === 'function') {
- document.msExitFullscreen();
- } else if (typeof document.mozCancelFullScreen === 'function') {
- document.mozCancelFullScreen();
- } else if (typeof document.webkitExitFullscreen === 'function') {
- document.webkitExitFullscreen();
+ } else {
+ /* eslint-disable no-lonely-if */
+
+ // $FlowFixMe
+ if (typeof document.exitFullscreen === 'function') {
+ document.exitFullscreen();
+
+ // $FlowFixMe
+ } else if (typeof document.mozCancelFullScreen === 'function') {
+ document.mozCancelFullScreen();
+
+ // $FlowFixMe
+ } else if (typeof document.webkitExitFullscreen === 'function') {
+ document.webkitExitFullscreen();
+ }
+
+ /* eslint-enable no-loney-if */
}
}
diff --git a/react/features/welcome/components/VideoSwitch.js b/react/features/welcome/components/VideoSwitch.js
index 0fe95c7a18..93e778151a 100644
--- a/react/features/welcome/components/VideoSwitch.js
+++ b/react/features/welcome/components/VideoSwitch.js
@@ -69,10 +69,10 @@ class VideoSwitch extends Component<Props> {
</View>
</TouchableWithoutFeedback>
<Switch
- onTintColor = { SWITCH_UNDER_COLOR }
onValueChange = { this._onStartAudioOnlyChange }
style = { styles.audioVideoSwitch }
- thumbTintColor = { SWITCH_THUMB_COLOR }
+ thumbColor = { SWITCH_THUMB_COLOR }
+ trackColor = {{ true: SWITCH_UNDER_COLOR }}
value = { _settings.startAudioOnly } />
<TouchableWithoutFeedback
onPress = { this._onStartAudioOnlyTrue }>