Przeglądaj źródła

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.
master
Saúl Ibarra Corretgé 5 lat temu
rodzic
commit
02131f3346

+ 11
- 0
react/features/base/dialog/functions.js Wyświetl plik

@@ -3,6 +3,17 @@
3 3
 import { ColorSchemeRegistry } from '../color-scheme';
4 4
 import { toState } from '../redux';
5 5
 
6
+/**
7
+ * Checks if any {@code Dialog} is currently open.
8
+ *
9
+ * @param {Function|Object} stateful - The redux store, the redux
10
+ * {@code getState} function, or the redux state itself.
11
+ * @returns {boolean}
12
+ */
13
+export function isAnyDialogOpen(stateful: Function) {
14
+    return Boolean(toState(stateful)['features/base/dialog'].component);
15
+}
16
+
6 17
 /**
7 18
  * Checks if a {@code Dialog} with a specific {@code component} is currently
8 19
  * open.

+ 5
- 2
react/features/mobile/full-screen/middleware.js Wyświetl plik

@@ -4,6 +4,7 @@ import { Immersive } from 'react-native-immersive';
4 4
 
5 5
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../base/app';
6 6
 import { getCurrentConference } from '../../base/conference';
7
+import { isAnyDialogOpen } from '../../base/dialog/functions';
7 8
 import { Platform } from '../../base/react';
8 9
 import { MiddlewareRegistry, StateListenerRegistry } from '../../base/redux';
9 10
 
@@ -48,8 +49,9 @@ StateListenerRegistry.register(
48 49
     /* selector */ state => {
49 50
         const { enabled: audioOnly } = state['features/base/audio-only'];
50 51
         const conference = getCurrentConference(state);
52
+        const dialogOpen = isAnyDialogOpen(state);
51 53
 
52
-        return conference ? !audioOnly : false;
54
+        return conference ? !audioOnly && !dialogOpen : false;
53 55
     },
54 56
     /* listener */ fullScreen => _setFullScreen(fullScreen)
55 57
 );
@@ -70,7 +72,8 @@ function _onImmersiveChange({ getState }) {
70 72
     if (appState === 'active') {
71 73
         const { enabled: audioOnly } = state['features/base/audio-only'];
72 74
         const conference = getCurrentConference(state);
73
-        const fullScreen = conference ? !audioOnly : false;
75
+        const dialogOpen = isAnyDialogOpen(state);
76
+        const fullScreen = conference ? !audioOnly && !dialogOpen : false;
74 77
 
75 78
         _setFullScreen(fullScreen);
76 79
     }

Ładowanie…
Anuluj
Zapisz