jiti-meet/react/features/video-layout/reducer.js

47 lines
950 B
JavaScript
Raw Normal View History

// @flow
import { PersistenceRegistry, ReducerRegistry } from '../base/redux';
import {
SCREEN_SHARE_PARTICIPANTS_UPDATED,
SET_TILE_VIEW
} from './actionTypes';
const DEFAULT_STATE = {
screenShares: [],
/**
* The indicator which determines whether the video layout should display
* video thumbnails in a tiled layout.
*
* @public
* @type {boolean}
*/
tileViewEnabled: false
};
const STORE_NAME = 'features/video-layout';
PersistenceRegistry.register(STORE_NAME, {
tileViewEnabled: true
});
ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
switch (action.type) {
case SCREEN_SHARE_PARTICIPANTS_UPDATED: {
return {
...state,
screenShares: action.participantIds
};
}
case SET_TILE_VIEW:
return {
...state,
tileViewEnabled: action.enabled
};
}
return state;
});