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.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { IStore } from '../app/types';
  2. import { openDialog } from '../base/dialog/actions';
  3. import AlertDialog from '../base/dialog/components/native/AlertDialog';
  4. import { getParticipantDisplayName } from '../base/participants/functions';
  5. import { DISMISS_CALENDAR_NOTIFICATION } from './actionTypes';
  6. /**
  7. * Notify that we've been kicked out of the conference.
  8. *
  9. * @param {JitsiParticipant} participant - The {@link JitsiParticipant}
  10. * instance which initiated the kick event.
  11. * @param {?Function} submit - The function to execute after submiting the dialog.
  12. * @returns {Function}
  13. */
  14. export function notifyKickedOut(participant: any, submit?: Function) {
  15. return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
  16. if (!participant || participant?.isReplaced?.()) {
  17. submit?.();
  18. return;
  19. }
  20. dispatch(openDialog(AlertDialog, {
  21. contentKey: {
  22. key: 'dialog.kickTitle',
  23. params: {
  24. participantDisplayName: getParticipantDisplayName(getState, participant.getId())
  25. }
  26. },
  27. onSubmit: submit
  28. }));
  29. };
  30. }
  31. /**
  32. * Dismisses calendar notification about next or ongoing event.
  33. *
  34. * @returns {Object}
  35. */
  36. export function dismissCalendarNotification() {
  37. return {
  38. type: DISMISS_CALENDAR_NOTIFICATION
  39. };
  40. }