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

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* @flow */
  2. import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
  3. /**
  4. * Sets the visibility of {@code CallOverlay}.
  5. *
  6. * @param {boolean|undefined} callOverlayVisible - If {@code CallOverlay} is to
  7. * be displayed/visible, then {@code true}; otherwise, {@code false} or
  8. * {@code undefined}.
  9. * @returns {{
  10. * type: SET_CALL_OVERLAY_VISIBLE,
  11. * callOverlayVisible: (boolean|undefined)
  12. * }}
  13. */
  14. export function setCallOverlayVisible(callOverlayVisible: boolean) {
  15. return (dispatch: Dispatch<*>, getState: Function) => {
  16. getState()['features/jwt'].callOverlayVisible === callOverlayVisible
  17. || dispatch({
  18. type: SET_CALL_OVERLAY_VISIBLE,
  19. callOverlayVisible
  20. });
  21. };
  22. }
  23. /**
  24. * Stores a specific JSON Web Token (JWT) into the redux store.
  25. *
  26. * @param {string} jwt - The JSON Web Token (JWT) to store.
  27. * @returns {{
  28. * type: SET_TOKEN_DATA,
  29. * jwt: string
  30. * }}
  31. */
  32. export function setJWT(jwt: string) {
  33. return {
  34. type: SET_JWT,
  35. jwt
  36. };
  37. }