Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { appNavigate } from '../app/actions.native';
  2. import { IStore } from '../app/types';
  3. import { conferenceLeft } from '../base/conference/actions';
  4. import { connectionFailed } from '../base/connection/actions.native';
  5. import { set } from '../base/redux/functions';
  6. import { CANCEL_LOGIN } from './actionTypes';
  7. import { stopWaitForOwner } from './actions.any';
  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 (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
  18. dispatch({ type: CANCEL_LOGIN });
  19. // XXX The error associated with CONNECTION_FAILED was marked as
  20. // recoverable by the authentication feature and, consequently,
  21. // recoverable-aware features such as mobile's external-api did not
  22. // deliver the CONFERENCE_FAILED to the SDK clients/consumers (as
  23. // a reaction to CONNECTION_FAILED). Since the
  24. // app/user is going to navigate to WelcomePage, the SDK
  25. // clients/consumers need an event.
  26. const { error = { recoverable: undefined }, passwordRequired }
  27. = getState()['features/base/connection'];
  28. passwordRequired
  29. && dispatch(
  30. connectionFailed(
  31. passwordRequired,
  32. set(error, 'recoverable', false) as any));
  33. };
  34. }
  35. /**
  36. * Cancels {@link WaitForOwnerDialog}. Will navigate back to the welcome page.
  37. *
  38. * @returns {Function}
  39. */
  40. export function cancelWaitForOwner() {
  41. return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
  42. dispatch(stopWaitForOwner());
  43. // XXX The error associated with CONFERENCE_FAILED was marked as
  44. // recoverable by the feature room-lock and, consequently,
  45. // recoverable-aware features such as mobile's external-api did not
  46. // deliver the CONFERENCE_FAILED to the SDK clients/consumers. Since the
  47. // app/user is going to nativate to WelcomePage, the SDK
  48. // clients/consumers need an event.
  49. const { authRequired } = getState()['features/base/conference'];
  50. if (authRequired) {
  51. dispatch(conferenceLeft(authRequired));
  52. // in case we are showing lobby and on top of it wait for owner
  53. // we do not want to navigate away from the conference
  54. dispatch(appNavigate(undefined));
  55. }
  56. };
  57. }
  58. /** .
  59. * Redirect to the default location (e.g. Welcome page).
  60. *
  61. * @returns {Function}
  62. */
  63. export function redirectToDefaultLocation() {
  64. return (dispatch: IStore['dispatch']) => dispatch(appNavigate(undefined));
  65. }