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.js 774B

1234567891011121314151617181920212223242526
  1. /* @flow */
  2. /**
  3. * Retrieves a simplified version of the conference/location URL stripped of URL
  4. * params (i.e. query/search and hash) which should be used for sending invites.
  5. *
  6. * @param {Function|Object} stateOrGetState - The redux state or redux's
  7. * {@code getState} function.
  8. * @returns {string|undefined}
  9. */
  10. export function getInviteURL(stateOrGetState: Function | Object): ?string {
  11. const state
  12. = typeof stateOrGetState === 'function'
  13. ? stateOrGetState()
  14. : stateOrGetState;
  15. const { locationURL } = state['features/base/connection'];
  16. let inviteURL;
  17. if (locationURL) {
  18. const { host, pathname, protocol } = locationURL;
  19. inviteURL = `${protocol}//${host}${pathname}`;
  20. }
  21. return inviteURL;
  22. }