Files
jitsi-meet/react/features/breakout-rooms/reducer.js
robertpin c2ab8935c1 fix(breakout-rooms) Improve breakout rooms
Don't show more menu on the main room

Fix join room on mobile web

When moving to room reset breakout rooms state to avoid showing incorrect data before response from prosody is received
2021-11-26 08:40:42 +01:00

43 lines
847 B
JavaScript

// @flow
import { ReducerRegistry } from '../base/redux';
import {
_RESET_BREAKOUT_ROOMS,
_UPDATE_ROOM_COUNTER,
UPDATE_BREAKOUT_ROOMS
} from './actionTypes';
import { FEATURE_KEY } from './constants';
const DEFAULT_STATE = {
rooms: {},
roomCounter: 0
};
/**
* Listen for actions for the breakout-rooms feature.
*/
ReducerRegistry.register(FEATURE_KEY, (state = DEFAULT_STATE, action) => {
switch (action.type) {
case _UPDATE_ROOM_COUNTER:
return {
...state,
roomCounter: action.roomCounter
};
case UPDATE_BREAKOUT_ROOMS: {
const { roomCounter, rooms } = action;
return {
...state,
roomCounter,
rooms
};
}
case _RESET_BREAKOUT_ROOMS: {
return DEFAULT_STATE;
}
}
return state;
});