snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
54
react/features/participants-pane/reducer.ts
Normal file
54
react/features/participants-pane/reducer.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import ReducerRegistry from '../base/redux/ReducerRegistry';
|
||||
|
||||
import {
|
||||
PARTICIPANTS_PANE_CLOSE,
|
||||
PARTICIPANTS_PANE_OPEN,
|
||||
SET_VOLUME
|
||||
} from './actionTypes';
|
||||
import { REDUCER_KEY } from './constants';
|
||||
|
||||
export interface IParticipantsPaneState {
|
||||
isOpen: boolean;
|
||||
participantsVolume: {
|
||||
[participantId: string]: number;
|
||||
};
|
||||
}
|
||||
|
||||
const DEFAULT_STATE = {
|
||||
isOpen: false,
|
||||
participantsVolume: {}
|
||||
};
|
||||
|
||||
/**
|
||||
* Listen for actions that mutate the participants pane state.
|
||||
*/
|
||||
ReducerRegistry.register(
|
||||
REDUCER_KEY, (state: IParticipantsPaneState = DEFAULT_STATE, action) => {
|
||||
switch (action.type) {
|
||||
case PARTICIPANTS_PANE_CLOSE:
|
||||
return {
|
||||
...state,
|
||||
isOpen: false
|
||||
};
|
||||
|
||||
case PARTICIPANTS_PANE_OPEN:
|
||||
return {
|
||||
...state,
|
||||
isOpen: true
|
||||
};
|
||||
|
||||
case SET_VOLUME:
|
||||
return {
|
||||
...state,
|
||||
participantsVolume: {
|
||||
...state.participantsVolume,
|
||||
|
||||
[action.participantId]: action.volume
|
||||
}
|
||||
};
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user