mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
Simplify the code by using a bitfied instead of a couple of boolean flags. This allows us to mute the video from multiple places and only make the unmute effective once they have all unmuted. Alas, this cannot be applied to the web without a massive refactor, because it uses the track muted state as the source of truth instead of the media state.
25 lines
515 B
JavaScript
25 lines
515 B
JavaScript
import { ReducerRegistry } from '../../base/redux';
|
|
|
|
import {
|
|
_SET_APP_STATE_LISTENER,
|
|
APP_STATE_CHANGED
|
|
} from './actionTypes';
|
|
|
|
ReducerRegistry.register('features/background', (state = {}, action) => {
|
|
switch (action.type) {
|
|
case _SET_APP_STATE_LISTENER:
|
|
return {
|
|
...state,
|
|
appStateListener: action.listener
|
|
};
|
|
|
|
case APP_STATE_CHANGED:
|
|
return {
|
|
...state,
|
|
appState: action.appState
|
|
};
|
|
}
|
|
|
|
return state;
|
|
});
|