Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

functions.native.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { isRoomValid } from '../base/conference';
  2. import { RouteRegistry } from '../base/react';
  3. import { Conference } from '../conference';
  4. import { BlankWelcomePage, WelcomePage } from '../welcome';
  5. /**
  6. * Determines which route is to be rendered in order to depict a specific Redux
  7. * store.
  8. *
  9. * @param {(Object|Function)} stateOrGetState - Redux state or Regux getState()
  10. * method.
  11. * @returns {Route}
  12. */
  13. export function _getRouteToRender(stateOrGetState) {
  14. const state
  15. = typeof stateOrGetState === 'function'
  16. ? stateOrGetState()
  17. : stateOrGetState;
  18. const { room } = state['features/base/conference'];
  19. let component;
  20. if (isRoomValid(room)) {
  21. component = Conference;
  22. } else {
  23. // The value of the App prop welcomePageEnabled was stored in redux in
  24. // saghul's PR. But I removed the redux state, action, action type, etc.
  25. // because I didn't like the name. We are not using the prop is a
  26. // React-ive way anyway so it's all the same difference.
  27. const { app } = state['features/app'];
  28. component
  29. = app && app.props.welcomePageEnabled
  30. ? WelcomePage
  31. : BlankWelcomePage;
  32. }
  33. return RouteRegistry.getRouteByComponent(component);
  34. }