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.

actions.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* @flow */
  2. import { BEGIN_SHARE_ROOM, END_SHARE_ROOM } from './actionTypes';
  3. /**
  4. * Begins the UI procedure to share the URL for the current conference/room.
  5. *
  6. * @param {string} roomURL - The URL of the room to share.
  7. * @public
  8. * @returns {Function}
  9. */
  10. export function beginShareRoom(roomURL: ?string): Function {
  11. return (dispatch, getState) => {
  12. if (!roomURL) {
  13. const { locationURL } = getState()['features/base/connection'];
  14. if (locationURL) {
  15. // eslint-disable-next-line no-param-reassign
  16. roomURL = locationURL.toString();
  17. }
  18. }
  19. roomURL && dispatch({
  20. type: BEGIN_SHARE_ROOM,
  21. roomURL
  22. });
  23. };
  24. }
  25. /**
  26. * Ends the UI procedure to share a specific conference/room URL.
  27. *
  28. * @param {string} roomURL - The URL of the conference/room which was shared.
  29. * @param {boolean} shared - True if the URL was shared successfully; false,
  30. * otherwise.
  31. * @public
  32. * @returns {{
  33. * type: END_SHARE_ROOM,
  34. * roomURL: string,
  35. * shared: boolean
  36. * }}
  37. */
  38. export function endShareRoom(roomURL: string, shared: boolean): Object {
  39. return {
  40. type: END_SHARE_ROOM,
  41. roomURL,
  42. shared
  43. };
  44. }