Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
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.
 
 
 
 
 
 
jitsi-meet/react/features/base/jwt/reducer.ts

35 lines
974 B

import ReducerRegistry from '../redux/ReducerRegistry';
import { equals } from '../redux/functions';
import { SET_JWT } from './actionTypes';
export interface IJwtState {
jwt?: string;
}
/**
* Reduces redux actions which affect the JSON Web Token (JWT) stored in the
* redux store.
*
* @param {Object} state - The current redux state.
* @param {Object} action - The redux action to reduce.
* @returns {Object} The next redux state which is the result of reducing the
* specified {@code action}.
*/
ReducerRegistry.register(
'features/base/jwt',
(state: IJwtState = {}, action) => {
switch (action.type) {
case SET_JWT: {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { type, ...payload } = action;
const nextState = {
...payload
};
return equals(state, nextState) ? state : nextState;
}
}
return state;
});