feat(flow): tame the beast

This commit is contained in:
Saúl Ibarra Corretgé 2018-10-03 11:29:19 +02:00 committed by Saúl Ibarra Corretgé
parent b71adbdf70
commit 7162080d00
10 changed files with 32 additions and 18 deletions

View File

@ -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
};

View File

@ -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.

View File

@ -95,6 +95,7 @@ export default class AbstractContainer<P: Props> extends Component<P> {
...filteredProps
} = props || this.props;
// $FlowFixMe
return React.createElement(type, filteredProps, children);
}
}

View File

@ -58,7 +58,7 @@ export default class Container<P: Props> extends AbstractContainer<P> {
accessibilityLabel,
accessible,
onPress: onClick,
underlayColor
...touchFeedback && { underlayColor }
},
element);
}

View File

@ -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);
}

View File

@ -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

View File

@ -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'

View File

@ -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]}`;
}

View File

@ -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 */
}
}

View File

@ -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 }>