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.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // @flow
  2. import {
  3. MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  4. SET_FATAL_ERROR
  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. }