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.any.js 1013B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // @flow
  2. import { type Dispatch } from 'redux';
  3. import {
  4. getCurrentConference
  5. } from '../base/conference';
  6. import { SET_LOBBY_VISIBILITY } from './actionTypes';
  7. /**
  8. * Action to toggle lobby mode on or off.
  9. *
  10. * @param {boolean} enabled - The desired (new) state of the lobby mode.
  11. * @returns {Function}
  12. */
  13. export function toggleLobbyMode(enabled: boolean) {
  14. return async (dispatch: Dispatch<any>, getState: Function) => {
  15. const conference = getCurrentConference(getState);
  16. if (enabled) {
  17. conference.enableLobby();
  18. } else {
  19. conference.disableLobby();
  20. }
  21. };
  22. }
  23. /**
  24. * Action to open the lobby screen.
  25. *
  26. * @returns {openDialog}
  27. */
  28. export function openLobbyScreen() {
  29. return {
  30. type: SET_LOBBY_VISIBILITY,
  31. visible: true
  32. };
  33. }
  34. /**
  35. * Action to hide the lobby screen.
  36. *
  37. * @returns {hideDialog}
  38. */
  39. export function hideLobbyScreen() {
  40. return {
  41. type: SET_LOBBY_VISIBILITY,
  42. visible: false
  43. };
  44. }