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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import {
  2. MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  3. SET_FATAL_ERROR,
  4. SUSPEND_DETECTED
  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, browser) {
  20. return {
  21. type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  22. browser,
  23. isVisible
  24. };
  25. }
  26. /**
  27. * Signals that suspend was detected.
  28. *
  29. * @public
  30. * @returns {{
  31. * type: SUSPEND_DETECTED
  32. * }}
  33. */
  34. export function suspendDetected() {
  35. return {
  36. type: SUSPEND_DETECTED
  37. };
  38. }
  39. /**
  40. * The action indicates that an unrecoverable error has occurred and the reload
  41. * screen will be displayed or hidden.
  42. *
  43. * @param {Object} fatalError - A critical error which was not claimed by any
  44. * feature for error recovery (the recoverable flag was not set). If
  45. * {@code undefined} then any fatal error currently stored will be discarded.
  46. * @returns {{
  47. * type: SET_FATAL_ERROR,
  48. * fatalError: ?Error
  49. * }}
  50. */
  51. export function setFatalError(fatalError) {
  52. return {
  53. type: SET_FATAL_ERROR,
  54. fatalError
  55. };
  56. }