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.

getRouteToRender.native.js 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { isRoomValid } from '../base/conference';
  2. import { toState } from '../base/redux';
  3. import { ConferenceNavigationContainer } from '../conference';
  4. import RootNavigationContainer from '../welcome/components/RootNavigationContainer';
  5. /**
  6. * Determines which route is to be rendered in order to depict a specific Redux
  7. * store.
  8. *
  9. * @param {(Function|Object)} stateful - THe redux store, state, or
  10. * {@code getState} function.
  11. * @returns {Promise<Object>}
  12. */
  13. export function _getRouteToRender(stateful) {
  14. const state = toState(stateful);
  15. return _getMobileRoute(state);
  16. }
  17. /**
  18. * Returns the {@code Route} to display on the React Native app.
  19. *
  20. * @param {Object} state - The redux state.
  21. * @returns {Promise}
  22. */
  23. function _getMobileRoute(state) {
  24. const route = {
  25. component: null,
  26. href: undefined
  27. };
  28. if (isRoomValid(state['features/base/conference'].room)) {
  29. route.component = ConferenceNavigationContainer;
  30. } else {
  31. route.component = RootNavigationContainer;
  32. }
  33. return Promise.resolve(route);
  34. }