Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

actions.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/base/jwt']
  17. .callOverlayVisible === callOverlayVisible
  18. || dispatch({
  19. type: SET_CALL_OVERLAY_VISIBLE,
  20. callOverlayVisible
  21. });
  22. };
  23. }
  24. /**
  25. * Stores a specific JSON Web Token (JWT) into the redux store.
  26. *
  27. * @param {string} jwt - The JSON Web Token (JWT) to store.
  28. * @returns {{
  29. * type: SET_TOKEN_DATA,
  30. * jwt: string
  31. * }}
  32. */
  33. export function setJWT(jwt: string) {
  34. return {
  35. type: SET_JWT,
  36. jwt
  37. };
  38. }