Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

actions.web.ts 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { IStore } from '../app/types';
  2. import { configureInitialDevices } from '../base/devices/actions.web';
  3. import { openDialog } from '../base/dialog/actions';
  4. import { getBackendSafeRoomName } from '../base/util/uri';
  5. import { DISMISS_CALENDAR_NOTIFICATION } from './actionTypes';
  6. import LeaveReasonDialog from './components/web/LeaveReasonDialog.web';
  7. import logger from './logger';
  8. /**
  9. * Opens {@code LeaveReasonDialog}.
  10. *
  11. * @param {string} [title] - The dialog title.
  12. *
  13. * @returns {Promise} Resolved when the dialog is closed.
  14. */
  15. export function openLeaveReasonDialog(title?: string) {
  16. return (dispatch: IStore['dispatch']): Promise<void> => new Promise(resolve => {
  17. dispatch(openDialog(LeaveReasonDialog, {
  18. onClose: resolve,
  19. title
  20. }));
  21. });
  22. }
  23. /**
  24. * Dismisses calendar notification about next or ongoing event.
  25. *
  26. * @returns {Object}
  27. */
  28. export function dismissCalendarNotification() {
  29. return {
  30. type: DISMISS_CALENDAR_NOTIFICATION
  31. };
  32. }
  33. /**
  34. * Init.
  35. *
  36. * @returns {Promise<JitsiConnection>}
  37. */
  38. export function init() {
  39. return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
  40. const room = getBackendSafeRoomName(getState()['features/base/conference'].room);
  41. // XXX For web based version we use conference initialization logic
  42. // from the old app (at the moment of writing).
  43. return dispatch(configureInitialDevices()).then(
  44. () => APP.conference.init({
  45. roomName: room
  46. }).catch((error: Error) => {
  47. APP.API.notifyConferenceLeft(APP.conference.roomName);
  48. logger.error(error);
  49. }));
  50. };
  51. }