jiti-meet/react/features/base/jwt/actions.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-10-13 19:31:05 +00:00
// @flow
2017-04-21 10:00:50 +00:00
import { SET_CALLEE_INFO_VISIBLE, SET_JWT } from './actionTypes';
/**
* Sets the visibility of {@code CalleeInfo}.
*
* @param {boolean|undefined} [calleeInfoVisible] - If {@code CalleeInfo} is
2017-10-13 19:31:05 +00:00
* to be displayed/visible, then {@code true}; otherwise, {@code false} or
* {@code undefined}.
* @returns {{
* type: SET_CALLEE_INFO_VISIBLE,
* calleeInfoVisible: (boolean|undefined)
* }}
*/
export function setCalleeInfoVisible(calleeInfoVisible: ?boolean) {
return (dispatch: Dispatch<*>, getState: Function) => {
2017-10-05 22:54:13 +00:00
getState()['features/base/jwt']
.calleeInfoVisible === calleeInfoVisible
|| dispatch({
type: SET_CALLEE_INFO_VISIBLE,
calleeInfoVisible
});
};
}
2017-04-21 10:00:50 +00:00
/**
* Stores a specific JSON Web Token (JWT) into the redux store.
*
2017-10-13 19:31:05 +00:00
* @param {string} [jwt] - The JSON Web Token (JWT) to store.
2017-04-21 10:00:50 +00:00
* @returns {{
* type: SET_TOKEN_DATA,
2017-10-13 19:31:05 +00:00
* jwt: (string|undefined)
2017-04-21 10:00:50 +00:00
* }}
*/
2017-10-13 19:31:05 +00:00
export function setJWT(jwt: ?string) {
2017-04-21 10:00:50 +00:00
return {
type: SET_JWT,
jwt
};
}