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.ts 1.2KB

12345678910111213141516171819202122232425262728293031323334
  1. import { IStore } from '../app/types';
  2. import { getParticipantDisplayName } from '../base/participants/functions';
  3. import { showNotification } from '../notifications/actions';
  4. import { NOTIFICATION_TIMEOUT_TYPE, NOTIFICATION_TYPE } from '../notifications/constants';
  5. /**
  6. * Notify that we've been kicked out of the conference.
  7. *
  8. * @param {JitsiParticipant} participant - The {@link JitsiParticipant}
  9. * instance which initiated the kick event.
  10. * @param {?Function} _ - Used only in native code.
  11. * @returns {Function}
  12. */
  13. export function notifyKickedOut(participant: any, _?: Function) {
  14. return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
  15. if (!participant || participant?.isReplaced()) {
  16. return;
  17. }
  18. const args = {
  19. participantDisplayName:
  20. getParticipantDisplayName(getState, participant.getId())
  21. };
  22. dispatch(showNotification({
  23. appearance: NOTIFICATION_TYPE.ERROR,
  24. hideErrorSupportLink: true,
  25. descriptionKey: 'dialog.kickMessage',
  26. descriptionArguments: args,
  27. titleKey: 'dialog.kickTitle',
  28. titleArguments: args
  29. }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
  30. };
  31. }