fix(mobile,navigation) remove end meeting page

It will just flash for a split second and all it does is dispatch
readyToClose, so do it directly instead.
This commit is contained in:
Saúl Ibarra Corretgé 2022-03-22 10:34:14 +01:00 committed by Saúl Ibarra Corretgé
parent a3c60d5943
commit 21083e6777
5 changed files with 16 additions and 52 deletions

View File

@ -39,9 +39,6 @@
"audioOnly": {
"audioOnly": "Low bandwidth"
},
"blankPage": {
"meetingEnded": "Meeting ended."
},
"breakoutRooms": {
"actions": {
"add": "Add breakout room",

View File

@ -7,7 +7,6 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
import { connect } from '../../../base/redux';
import { DialInSummary } from '../../../invite';
import EndMeetingPage from '../../../welcome/components/EndMeetingPage';
import { rootNavigationRef } from '../rootNavigationContainerRef';
import { screen } from '../routes';
import {
@ -71,13 +70,6 @@ const RootNavigationContainer = ({ isWelcomePageAvailable }: Props) => {
gestureEnabled: false,
headerShown: false
}} />
<RootStack.Screen
component = { EndMeetingPage }
name = { screen.endMeeting }
options = {{
gestureEnabled: false,
headerShown: false
}} />
</RootStack.Navigator>
</NavigationContainer>
</SafeAreaProvider>

View File

@ -1,7 +1,11 @@
// @flow
import debounce from 'lodash/debounce';
import { SET_ROOM } from '../../base/conference/actionTypes';
import { MiddlewareRegistry } from '../../base/redux';
import { readyToClose } from '../external-api/actions';
import { isWelcomePageAppEnabled } from './components/welcome/functions';
import { navigateRoot } from './rootNavigationContainerRef';
@ -17,6 +21,12 @@ MiddlewareRegistry.register(store => next => action => {
return next(action);
});
/**
* Debounced sending of `readyToClose`.
*/
const _sendReadyToClose = debounce(dispatch => {
dispatch(readyToClose());
}, 2500, { leading: true });
/**
* Notifies the feature base/conference that the action
@ -32,11 +42,11 @@ MiddlewareRegistry.register(store => next => action => {
* @private
* @returns {Object} The value returned by {@code next(action)}.
*/
function _setRoom(store, next, action) {
const { room: oldRoom } = store.getState()['features/base/conference'];
function _setRoom({ dispatch, getState }, next, action) {
const { room: oldRoom } = getState()['features/base/conference'];
const result = next(action);
const { room: newRoom } = store.getState()['features/base/conference'];
const isWelcomePageEnabled = isWelcomePageAppEnabled(store.getState());
const { room: newRoom } = getState()['features/base/conference'];
const isWelcomePageEnabled = isWelcomePageAppEnabled(getState());
if (!oldRoom && newRoom) {
navigateRoot(screen.conference.root);
@ -45,7 +55,7 @@ function _setRoom(store, next, action) {
navigateRoot(screen.root);
} else {
// For JitsiSDK, WelcomePage is not available
navigateRoot(screen.endMeeting);
_sendReadyToClose(dispatch);
}
}

View File

@ -33,6 +33,5 @@ export const screen = {
invite: 'Invite',
sharedDocument: 'Shared document'
},
lobby: 'Lobby',
endMeeting: 'End'
lobby: 'Lobby'
};

View File

@ -1,34 +0,0 @@
// @flow
import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { Text, View } from 'react-native';
import { useDispatch } from 'react-redux';
import { readyToClose } from '../../mobile/external-api/actions';
import styles from './styles';
const BlankPage = () => {
const dispatch = useDispatch();
const { t } = useTranslation();
/**
* Destroys the local tracks (if any) since no media is desired when this
* component is rendered.
*/
useEffect(() => {
dispatch(readyToClose());
}, []);
return (
<View style = { styles.blankPageWrapper }>
<Text style = { styles.blankPageText }>
{ t('blankPage.meetingEnded') }
</Text>
</View>
);
};
export default BlankPage;