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

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // @flow
  2. import { SET_CALLEE_INFO_VISIBLE, SET_JWT } from './actionTypes';
  3. /**
  4. * Sets the visibility of {@code CalleeInfo}.
  5. *
  6. * @param {boolean|undefined} [calleeInfoVisible] - If {@code CalleeInfo} is
  7. * to be displayed/visible, then {@code true}; otherwise, {@code false} or
  8. * {@code undefined}.
  9. * @returns {{
  10. * type: SET_CALLEE_INFO_VISIBLE,
  11. * calleeInfoVisible: (boolean|undefined)
  12. * }}
  13. */
  14. export function setCalleeInfoVisible(calleeInfoVisible: ?boolean) {
  15. return (dispatch: Dispatch<*>, getState: Function) => {
  16. getState()['features/base/jwt']
  17. .calleeInfoVisible === calleeInfoVisible
  18. || dispatch({
  19. type: SET_CALLEE_INFO_VISIBLE,
  20. calleeInfoVisible
  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|undefined)
  31. * }}
  32. */
  33. export function setJWT(jwt: ?string) {
  34. return {
  35. type: SET_JWT,
  36. jwt
  37. };
  38. }