mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-04-28 15:10:21 +00:00
This refactors all handling of audio-only and last N to 2 features in preparation for "low bandwidth mode". The main motivation to do this is that lastN is a "global" setting so it helps to have all processing for it in a single place.
34 lines
657 B
JavaScript
34 lines
657 B
JavaScript
// @flow
|
|
|
|
import { ReducerRegistry } from '../../base/redux';
|
|
|
|
import {
|
|
_SET_APP_STATE_LISTENER,
|
|
APP_STATE_CHANGED
|
|
} from './actionTypes';
|
|
|
|
/**
|
|
* The default/initial redux state of the feature background.
|
|
*/
|
|
const DEFAULT_STATE = {
|
|
appState: 'active'
|
|
};
|
|
|
|
ReducerRegistry.register('features/background', (state = DEFAULT_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;
|
|
});
|