Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

actions.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { openDialog } from '../../features/base/dialog';
  2. import {
  3. UPDATE_DIAL_IN_NUMBERS_FAILED,
  4. UPDATE_DIAL_IN_NUMBERS_REQUEST,
  5. UPDATE_DIAL_IN_NUMBERS_SUCCESS
  6. } from './actionTypes';
  7. import { InviteDialog } from './components';
  8. declare var $: Function;
  9. declare var APP: Object;
  10. declare var config: Object;
  11. /**
  12. * Opens the Invite Dialog.
  13. *
  14. * @returns {Function}
  15. */
  16. export function openInviteDialog() {
  17. return openDialog(InviteDialog, {
  18. conferenceUrl: encodeURI(APP.ConferenceUrl.getInviteUrl()),
  19. dialInNumbersUrl: config.dialInNumbersUrl
  20. });
  21. }
  22. /**
  23. * Sends an ajax request for dial-in numbers.
  24. *
  25. * @param {string} dialInNumbersUrl - The endpoint for retrieving json that
  26. * includes numbers for dialing in to a conference.
  27. * @returns {Function}
  28. */
  29. export function updateDialInNumbers(dialInNumbersUrl) {
  30. return dispatch => {
  31. dispatch({
  32. type: UPDATE_DIAL_IN_NUMBERS_REQUEST
  33. });
  34. $.getJSON(dialInNumbersUrl)
  35. .success(response =>
  36. dispatch({
  37. type: UPDATE_DIAL_IN_NUMBERS_SUCCESS,
  38. response
  39. }))
  40. .error(error =>
  41. dispatch({
  42. type: UPDATE_DIAL_IN_NUMBERS_FAILED,
  43. error
  44. }));
  45. };
  46. }