Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

actions.ts 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import {
  2. MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  3. SET_FATAL_ERROR,
  4. SET_PAGE_RELOAD_OVERLAY_CANCELED
  5. } from './actionTypes';
  6. /**
  7. * Signals that the prompt for media permission is visible or not.
  8. *
  9. * @param {boolean} isVisible - If the value is true - the prompt for media
  10. * permission is visible otherwise the value is false/undefined.
  11. * @param {string} browser - The name of the current browser.
  12. * @public
  13. * @returns {{
  14. * type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  15. * browser: {string},
  16. * isVisible: {boolean}
  17. * }}
  18. */
  19. export function mediaPermissionPromptVisibilityChanged(isVisible: boolean, browser: string) {
  20. return {
  21. type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  22. browser,
  23. isVisible
  24. };
  25. }
  26. /**
  27. * The action indicates that an unrecoverable error has occurred and the reload
  28. * screen will be displayed or hidden.
  29. *
  30. * @param {Object} fatalError - A critical error which was not claimed by any
  31. * feature for error recovery (the recoverable flag was not set). If
  32. * {@code undefined} then any fatal error currently stored will be discarded.
  33. * @returns {{
  34. * type: SET_FATAL_ERROR,
  35. * fatalError: ?Error
  36. * }}
  37. */
  38. export function setFatalError(fatalError?: Object) {
  39. return {
  40. type: SET_FATAL_ERROR,
  41. fatalError
  42. };
  43. }
  44. /**
  45. * The action indicates that the overlay was canceled.
  46. *
  47. * @param {Object} error - The error that caused the display of the overlay.
  48. *
  49. * @returns {{
  50. * type: SET_PAGE_RELOAD_OVERLAY_CANCELED,
  51. * error: ?Error
  52. * }}
  53. */
  54. export function setPageReloadOverlayCanceled(error: Object) {
  55. return {
  56. type: SET_PAGE_RELOAD_OVERLAY_CANCELED,
  57. error
  58. };
  59. }