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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // @flow
  2. import {
  3. MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  4. SET_FATAL_ERROR,
  5. TOGGLE_SLOW_GUM_OVERLAY
  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 the prompt for media permission is visible or not.
  29. *
  30. * @param {boolean} isVisible - If the value is true - the prompt for media
  31. * permission is visible otherwise the value is false/undefined.
  32. * @public
  33. * @returns {{
  34. * type: SLOW_GET_USER_MEDIA_OVERLAY,
  35. * isVisible: {boolean}
  36. * }}
  37. */
  38. export function toggleSlowGUMOverlay(isVisible: boolean) {
  39. return {
  40. type: TOGGLE_SLOW_GUM_OVERLAY,
  41. isVisible
  42. };
  43. }
  44. /**
  45. * The action indicates that an unrecoverable error has occurred and the reload
  46. * screen will be displayed or hidden.
  47. *
  48. * @param {Object} fatalError - A critical error which was not claimed by any
  49. * feature for error recovery (the recoverable flag was not set). If
  50. * {@code undefined} then any fatal error currently stored will be discarded.
  51. * @returns {{
  52. * type: SET_FATAL_ERROR,
  53. * fatalError: ?Error
  54. * }}
  55. */
  56. export function setFatalError(fatalError: Object) {
  57. return {
  58. type: SET_FATAL_ERROR,
  59. fatalError
  60. };
  61. }