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.web.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // @flow
  2. import { maybeRedirectToWelcomePage } from '../app/actions';
  3. import { hideDialog, openDialog } from '../base/dialog/actions';
  4. import {
  5. CANCEL_LOGIN
  6. } from './actionTypes';
  7. import { WaitForOwnerDialog, LoginDialog } from './components';
  8. export * from './actions.any';
  9. /**
  10. * Cancels {@ink LoginDialog}.
  11. *
  12. * @returns {{
  13. * type: CANCEL_LOGIN
  14. * }}
  15. */
  16. export function cancelLogin() {
  17. return {
  18. type: CANCEL_LOGIN
  19. };
  20. }
  21. /**
  22. * Cancels authentication, closes {@link WaitForOwnerDialog}
  23. * and navigates back to the welcome page.
  24. *
  25. * @returns {Function}
  26. */
  27. export function cancelWaitForOwner() {
  28. return (dispatch: Function) => {
  29. dispatch(maybeRedirectToWelcomePage());
  30. };
  31. }
  32. /**
  33. * Hides a authentication dialog where the local participant
  34. * should authenticate.
  35. *
  36. * @returns {Function}.
  37. */
  38. export function hideLoginDialog() {
  39. return hideDialog(LoginDialog);
  40. }
  41. /**
  42. * Shows a notification dialog that authentication is required to create the.
  43. * Conference.
  44. * This is used for external auth.
  45. *
  46. * @param {string} room - The room name.
  47. * @param {Function} onAuthNow - The function to be invoked when external authentication.
  48. *
  49. * @returns {Function}.
  50. */
  51. export function openAuthDialog(room: String, onAuthNow: ?Function) {
  52. return openDialog(WaitForOwnerDialog, {
  53. room,
  54. onAuthNow
  55. });
  56. }