full-screen: fix not re-entering full-screen after dialog is shown
This has the side effect of showing the bottom navbar when the toolbox is open, which is a nice thing since back is accessible.
This commit is contained in:
parent
8dbd1ba1b7
commit
02131f3346
@ -3,6 +3,17 @@
|
|||||||
import { ColorSchemeRegistry } from '../color-scheme';
|
import { ColorSchemeRegistry } from '../color-scheme';
|
||||||
import { toState } from '../redux';
|
import { toState } from '../redux';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if any {@code Dialog} is currently open.
|
||||||
|
*
|
||||||
|
* @param {Function|Object} stateful - The redux store, the redux
|
||||||
|
* {@code getState} function, or the redux state itself.
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
export function isAnyDialogOpen(stateful: Function) {
|
||||||
|
return Boolean(toState(stateful)['features/base/dialog'].component);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a {@code Dialog} with a specific {@code component} is currently
|
* Checks if a {@code Dialog} with a specific {@code component} is currently
|
||||||
* open.
|
* open.
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { Immersive } from 'react-native-immersive';
|
|||||||
|
|
||||||
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../base/app';
|
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../base/app';
|
||||||
import { getCurrentConference } from '../../base/conference';
|
import { getCurrentConference } from '../../base/conference';
|
||||||
|
import { isAnyDialogOpen } from '../../base/dialog/functions';
|
||||||
import { Platform } from '../../base/react';
|
import { Platform } from '../../base/react';
|
||||||
import { MiddlewareRegistry, StateListenerRegistry } from '../../base/redux';
|
import { MiddlewareRegistry, StateListenerRegistry } from '../../base/redux';
|
||||||
|
|
||||||
@ -48,8 +49,9 @@ StateListenerRegistry.register(
|
|||||||
/* selector */ state => {
|
/* selector */ state => {
|
||||||
const { enabled: audioOnly } = state['features/base/audio-only'];
|
const { enabled: audioOnly } = state['features/base/audio-only'];
|
||||||
const conference = getCurrentConference(state);
|
const conference = getCurrentConference(state);
|
||||||
|
const dialogOpen = isAnyDialogOpen(state);
|
||||||
|
|
||||||
return conference ? !audioOnly : false;
|
return conference ? !audioOnly && !dialogOpen : false;
|
||||||
},
|
},
|
||||||
/* listener */ fullScreen => _setFullScreen(fullScreen)
|
/* listener */ fullScreen => _setFullScreen(fullScreen)
|
||||||
);
|
);
|
||||||
@ -70,7 +72,8 @@ function _onImmersiveChange({ getState }) {
|
|||||||
if (appState === 'active') {
|
if (appState === 'active') {
|
||||||
const { enabled: audioOnly } = state['features/base/audio-only'];
|
const { enabled: audioOnly } = state['features/base/audio-only'];
|
||||||
const conference = getCurrentConference(state);
|
const conference = getCurrentConference(state);
|
||||||
const fullScreen = conference ? !audioOnly : false;
|
const dialogOpen = isAnyDialogOpen(state);
|
||||||
|
const fullScreen = conference ? !audioOnly && !dialogOpen : false;
|
||||||
|
|
||||||
_setFullScreen(fullScreen);
|
_setFullScreen(fullScreen);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user