Browse Source

fix(prejoin) Hide prejoin screen on init join conference

master
hmuresan 4 years ago
parent
commit
97ea155905

+ 1
- 2
react/features/base/conference/middleware.web.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { setPrejoinPageVisibility, setSkipPrejoinOnReload } from '../../prejoin';
3
 import { setPrejoinPageVisibility, setSkipPrejoinOnReload } from '../../prejoin';
4
-import { PREJOIN_SCREEN_STATES } from '../../prejoin/constants';
5
 import { JitsiConferenceErrors } from '../lib-jitsi-meet';
4
 import { JitsiConferenceErrors } from '../lib-jitsi-meet';
6
 import { MiddlewareRegistry } from '../redux';
5
 import { MiddlewareRegistry } from '../redux';
7
 
6
 
14
     switch (action.type) {
13
     switch (action.type) {
15
     case CONFERENCE_JOINED: {
14
     case CONFERENCE_JOINED: {
16
         if (enableForcedReload) {
15
         if (enableForcedReload) {
17
-            dispatch(setPrejoinPageVisibility(PREJOIN_SCREEN_STATES.HIDDEN));
16
+            dispatch(setPrejoinPageVisibility(false));
18
             dispatch(setSkipPrejoinOnReload(false));
17
             dispatch(setSkipPrejoinOnReload(false));
19
         }
18
         }
20
 
19
 

+ 2
- 2
react/features/conference/components/web/Conference.js View File

17
 import { getIsLobbyVisible } from '../../../lobby/functions';
17
 import { getIsLobbyVisible } from '../../../lobby/functions';
18
 import { ParticipantsPane } from '../../../participants-pane/components/web';
18
 import { ParticipantsPane } from '../../../participants-pane/components/web';
19
 import { getParticipantsPaneOpen } from '../../../participants-pane/functions';
19
 import { getParticipantsPaneOpen } from '../../../participants-pane/functions';
20
-import { Prejoin, isPrejoinPageVisible, isPrejoinPageLoading } from '../../../prejoin';
20
+import { Prejoin, isPrejoinPageVisible } from '../../../prejoin';
21
 import { fullScreenChanged, showToolbox } from '../../../toolbox/actions.web';
21
 import { fullScreenChanged, showToolbox } from '../../../toolbox/actions.web';
22
 import { JitsiPortal, Toolbox } from '../../../toolbox/components/web';
22
 import { JitsiPortal, Toolbox } from '../../../toolbox/components/web';
23
 import { LAYOUTS, getCurrentLayout } from '../../../video-layout';
23
 import { LAYOUTS, getCurrentLayout } from '../../../video-layout';
391
         _overflowDrawer: overflowDrawer,
391
         _overflowDrawer: overflowDrawer,
392
         _roomName: getConferenceNameForTitle(state),
392
         _roomName: getConferenceNameForTitle(state),
393
         _showLobby: getIsLobbyVisible(state),
393
         _showLobby: getIsLobbyVisible(state),
394
-        _showPrejoin: isPrejoinPageVisible(state) || isPrejoinPageLoading(state)
394
+        _showPrejoin: isPrejoinPageVisible(state)
395
     };
395
     };
396
 }
396
 }
397
 
397
 

+ 3
- 4
react/features/prejoin/actions.js View File

37
     SET_PREJOIN_PAGE_VISIBILITY,
37
     SET_PREJOIN_PAGE_VISIBILITY,
38
     SET_DEVICE_STATUS
38
     SET_DEVICE_STATUS
39
 } from './actionTypes';
39
 } from './actionTypes';
40
-import { type PREJOIN_SCREEN_STATE, PREJOIN_SCREEN_STATES } from './constants';
41
 import {
40
 import {
42
     getFullDialOutNumber,
41
     getFullDialOutNumber,
43
     getDialOutConferenceUrl,
42
     getDialOutConferenceUrl,
260
 
259
 
261
         const jitsiTracks = localTracks.map(t => t.jitsiTrack);
260
         const jitsiTracks = localTracks.map(t => t.jitsiTrack);
262
 
261
 
263
-        dispatch(setPrejoinPageVisibility(PREJOIN_SCREEN_STATES.LOADING));
262
+        dispatch(setPrejoinPageVisibility(false));
264
 
263
 
265
         APP.conference.prejoinStart(jitsiTracks);
264
         APP.conference.prejoinStart(jitsiTracks);
266
     };
265
     };
556
 /**
555
 /**
557
  * Action used to set the visibility of the prejoin page.
556
  * Action used to set the visibility of the prejoin page.
558
  *
557
  *
559
- * @param {string} value - The value.
558
+ * @param {boolean} value - The value.
560
  * @returns {Object}
559
  * @returns {Object}
561
  */
560
  */
562
-export function setPrejoinPageVisibility(value: PREJOIN_SCREEN_STATE) {
561
+export function setPrejoinPageVisibility(value: boolean) {
563
     return {
562
     return {
564
         type: SET_PREJOIN_PAGE_VISIBILITY,
563
         type: SET_PREJOIN_PAGE_VISIBILITY,
565
         value
564
         value

+ 0
- 19
react/features/prejoin/constants.js View File

1
-// @flow
2
-
3
-export type PREJOIN_SCREEN_STATE = "hidden" | "loading" | true;
4
-
5
-
6
-type PREJOIN_SCREEN_STATE_TYPE = {
7
-    HIDDEN: PREJOIN_SCREEN_STATE,
8
-    LOADING: PREJOIN_SCREEN_STATE,
9
-    VISIBLE: PREJOIN_SCREEN_STATE
10
-  }
11
-
12
-/**
13
- * Enum of possible prejoin screen states.
14
- */
15
-export const PREJOIN_SCREEN_STATES: PREJOIN_SCREEN_STATE_TYPE = {
16
-    HIDDEN: 'hidden',
17
-    LOADING: 'loading',
18
-    VISIBLE: true // backwards compatibility with old boolean implementation
19
-};

+ 1
- 13
react/features/prejoin/functions.js View File

4
 import { getDialOutStatusUrl, getDialOutUrl } from '../base/config/functions';
4
 import { getDialOutStatusUrl, getDialOutUrl } from '../base/config/functions';
5
 import { isAudioMuted, isVideoMutedByUser } from '../base/media';
5
 import { isAudioMuted, isVideoMutedByUser } from '../base/media';
6
 
6
 
7
-import { PREJOIN_SCREEN_STATES } from './constants';
8
-
9
 /**
7
 /**
10
  * Selector for the visibility of the 'join by phone' button.
8
  * Selector for the visibility of the 'join by phone' button.
11
  *
9
  *
162
  * @returns {boolean}
160
  * @returns {boolean}
163
  */
161
  */
164
 export function isPrejoinPageVisible(state: Object): boolean {
162
 export function isPrejoinPageVisible(state: Object): boolean {
165
-    return isPrejoinPageEnabled(state) && state['features/prejoin']?.showPrejoin === PREJOIN_SCREEN_STATES.VISIBLE;
166
-}
167
-
168
-/**
169
- * Returns true if the prejoin page is loading.
170
- *
171
- * @param {Object} state - The state of the app.
172
- * @returns {boolean}
173
- */
174
-export function isPrejoinPageLoading(state: Object): boolean {
175
-    return isPrejoinPageEnabled(state) && state['features/prejoin']?.showPrejoin === PREJOIN_SCREEN_STATES.LOADING;
163
+    return isPrejoinPageEnabled(state) && state['features/prejoin']?.showPrejoin;
176
 }
164
 }
177
 
165
 
178
 /**
166
 /**

+ 1
- 4
react/features/prejoin/middleware.js View File

15
     setJoiningInProgress,
15
     setJoiningInProgress,
16
     setPrejoinPageVisibility
16
     setPrejoinPageVisibility
17
 } from './actions';
17
 } from './actions';
18
-import { PREJOIN_SCREEN_STATES } from './constants';
19
 import { isPrejoinPageVisible } from './functions';
18
 import { isPrejoinPageVisible } from './functions';
20
 
19
 
21
-declare var APP: Object;
22
-
23
 /**
20
 /**
24
  * The redux middleware for {@link PrejoinPage}.
21
  * The redux middleware for {@link PrejoinPage}.
25
  *
22
  *
88
  * @returns {Object}
85
  * @returns {Object}
89
  */
86
  */
90
 function _conferenceJoined({ dispatch }, next, action) {
87
 function _conferenceJoined({ dispatch }, next, action) {
91
-    dispatch(setPrejoinPageVisibility(PREJOIN_SCREEN_STATES.HIDDEN));
88
+    dispatch(setPrejoinPageVisibility(false));
92
     dispatch(setJoiningInProgress(false));
89
     dispatch(setJoiningInProgress(false));
93
 
90
 
94
     return next(action);
91
     return next(action);

+ 1
- 2
react/features/settings/actions.js View File

5
 import { i18next } from '../base/i18n';
5
 import { i18next } from '../base/i18n';
6
 import { updateSettings } from '../base/settings';
6
 import { updateSettings } from '../base/settings';
7
 import { setPrejoinPageVisibility } from '../prejoin/actions';
7
 import { setPrejoinPageVisibility } from '../prejoin/actions';
8
-import { PREJOIN_SCREEN_STATES } from '../prejoin/constants';
9
 import { setScreenshareFramerate } from '../screen-share/actions';
8
 import { setScreenshareFramerate } from '../screen-share/actions';
10
 
9
 
11
 import {
10
 import {
85
             // The 'showPrejoin' flag starts as 'true' on every new session.
84
             // The 'showPrejoin' flag starts as 'true' on every new session.
86
             // This prevents displaying the prejoin page when the user re-enables it.
85
             // This prevents displaying the prejoin page when the user re-enables it.
87
             if (showPrejoinPage && getState()['features/prejoin']?.showPrejoin) {
86
             if (showPrejoinPage && getState()['features/prejoin']?.showPrejoin) {
88
-                dispatch(setPrejoinPageVisibility(PREJOIN_SCREEN_STATES.HIDDEN));
87
+                dispatch(setPrejoinPageVisibility(false));
89
             }
88
             }
90
             dispatch(updateSettings({
89
             dispatch(updateSettings({
91
                 userSelectedSkipPrejoin: !showPrejoinPage
90
                 userSelectedSkipPrejoin: !showPrejoinPage

Loading…
Cancel
Save