Files
jitsi-meet/react/features/mobile/background/reducer.js
Saúl Ibarra Corretgé 4757c1ebca [RN] Make full-screen more resilient on Android
On Android we go into "immersive mode" when in a conference, this is our way of
being full-creen. There are occasions, however, in which Android takes us out of
immerfive mode without us (the application / SDK) knowing: when a child activity
is started, a modal window shown, etc.

In order to be resilient to any possible change in the immersive mode, register
a listener which will be called when Android changes it, so we can re-eavluate
if we need it and thus re-enable it.
2018-02-13 15:00:36 -06:00

31 lines
642 B
JavaScript

import { ReducerRegistry } from '../../base/redux';
import {
_SET_APP_STATE_LISTENER,
APP_STATE_CHANGED
} from './actionTypes';
const INITIAL_STATE = {
appState: 'active'
};
ReducerRegistry.register(
'features/background',
(state = INITIAL_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;
});