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.native.ts 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { appNavigate } from '../../app/actions.native';
  2. import { IStore } from '../../app/types';
  3. import { navigateRoot } from '../../mobile/navigation/rootNavigationContainerRef';
  4. import { screen } from '../../mobile/navigation/routes';
  5. import { JitsiConnectionErrors } from '../lib-jitsi-meet';
  6. import { _connectInternal } from './actions.any';
  7. export * from './actions.any';
  8. /**
  9. * Opens new connection.
  10. *
  11. * @param {string} [id] - The XMPP user's ID (e.g. {@code user@server.com}).
  12. * @param {string} [password] - The XMPP user's password.
  13. * @returns {Function}
  14. */
  15. export function connect(id?: string, password?: string) {
  16. return (dispatch: IStore['dispatch']) => dispatch(_connectInternal(id, password))
  17. .catch(error => {
  18. if (error === JitsiConnectionErrors.NOT_LIVE_ERROR) {
  19. navigateRoot(screen.visitorsQueue);
  20. }
  21. });
  22. }
  23. /**
  24. * Hangup.
  25. *
  26. * @param {boolean} [_requestFeedback] - Whether to attempt showing a
  27. * request for call feedback.
  28. * @returns {Function}
  29. */
  30. export function hangup(_requestFeedback = false) {
  31. return (dispatch: IStore['dispatch']) => dispatch(appNavigate(undefined));
  32. }