You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.native.js 786B

12345678910111213141516171819202122232425
  1. /* @flow */
  2. import { isRoomValid } from '../base/conference';
  3. import { RouteRegistry } from '../base/react';
  4. import { Conference } from '../conference';
  5. import { Entryway } from '../welcome';
  6. /**
  7. * Determines which route is to be rendered in order to depict a specific Redux
  8. * store.
  9. *
  10. * @param {(Object|Function)} stateOrGetState - Redux state or Regux getState()
  11. * method.
  12. * @returns {Route}
  13. */
  14. export function _getRouteToRender(stateOrGetState: Object | Function) {
  15. const state
  16. = typeof stateOrGetState === 'function'
  17. ? stateOrGetState()
  18. : stateOrGetState;
  19. const { room } = state['features/base/conference'];
  20. const component = isRoomValid(room) ? Conference : Entryway;
  21. return RouteRegistry.getRouteByComponent(component);
  22. }