Files
jitsi-meet/react/features/mobile/background/reducer.js
Saúl Ibarra Corretgé d600504d85 [RN] Refactor video muting
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.
2017-08-04 16:07:48 -05:00

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