jiti-meet/react/features/app/functions.native.js

23 lines
725 B
JavaScript
Raw Normal View History

/* @flow */
import { isRoomValid } from '../base/conference';
import { RouteRegistry } from '../base/react';
2017-09-01 21:25:48 +00:00
import { toState } from '../base/redux';
import { Conference } from '../conference';
import { WelcomePage } from '../welcome';
/**
* Determines which route is to be rendered in order to depict a specific Redux
* store.
*
* @param {(Object|Function)} stateOrGetState - Redux state or Regux getState()
* method.
* @returns {Route}
*/
export function _getRouteToRender(stateOrGetState: Object | Function) {
2017-09-01 21:25:48 +00:00
const { room } = toState(stateOrGetState)['features/base/conference'];
const component = isRoomValid(room) ? Conference : WelcomePage;
return RouteRegistry.getRouteByComponent(component);
}