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.js 1.5KB

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