Files
jitsi-meet/react/features/mobile/background/reducer.js
Saúl Ibarra Corretgé 467c9d36cf audio-only,lastn: move audio-only and last N handling to standalone features
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.
2019-08-02 15:54:47 +02:00

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;
});