fix(rn,lobby) fix lobby not showing up on subsequent tries

We need to make sure to hide it explicitly so the Redux state is in sync
with reality.
This commit is contained in:
Saúl Ibarra Corretgé 2022-03-29 14:30:34 +02:00
parent 664552bc05
commit c028511aaf
1 changed files with 9 additions and 6 deletions

View File

@ -1,9 +1,9 @@
// @flow
import { type Dispatch } from 'redux';
import { batch } from 'react-redux';
import { appNavigate } from '../app/actions';
import { hideLobbyScreen, setKnockingState } from './actions.any';
export * from './actions.any';
/**
@ -12,8 +12,11 @@ export * from './actions.any';
* @returns {Function}
*/
export function cancelKnocking() {
return async (dispatch: Dispatch<any>) => {
dispatch(appNavigate(undefined));
return dispatch => {
batch(() => {
dispatch(setKnockingState(false));
dispatch(hideLobbyScreen());
dispatch(appNavigate(undefined));
});
};
}