2022-03-29 12:30:34 +00:00
|
|
|
import { batch } from 'react-redux';
|
2021-09-23 09:12:31 +00:00
|
|
|
|
2022-11-23 09:12:26 +00:00
|
|
|
import { appNavigate } from '../app/actions.native';
|
|
|
|
import { IStore } from '../app/types';
|
2020-05-20 08:25:31 +00:00
|
|
|
|
2022-03-29 12:30:34 +00:00
|
|
|
import { hideLobbyScreen, setKnockingState } from './actions.any';
|
|
|
|
|
2021-09-23 09:12:31 +00:00
|
|
|
export * from './actions.any';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancels the ongoing knocking and abandons the join flow.
|
|
|
|
*
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
export function cancelKnocking() {
|
2022-11-23 09:12:26 +00:00
|
|
|
return (dispatch: IStore['dispatch']) => {
|
2022-03-29 12:30:34 +00:00
|
|
|
batch(() => {
|
|
|
|
dispatch(setKnockingState(false));
|
|
|
|
dispatch(hideLobbyScreen());
|
|
|
|
dispatch(appNavigate(undefined));
|
|
|
|
});
|
2021-09-23 09:12:31 +00:00
|
|
|
};
|
|
|
|
}
|