Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
29 lines
746 B
TypeScript
29 lines
746 B
TypeScript
import { appNavigate } from '../app/actions.native';
|
|
import { KICKED_OUT } from '../base/conference/actionTypes';
|
|
import { conferenceLeft } from '../base/conference/actions.native';
|
|
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
|
|
|
|
import { notifyKickedOut } from './actions.native';
|
|
|
|
import './middleware.any';
|
|
|
|
MiddlewareRegistry.register(store => next => action => {
|
|
switch (action.type) {
|
|
case KICKED_OUT: {
|
|
const { dispatch } = store;
|
|
|
|
dispatch(notifyKickedOut(
|
|
action.participant,
|
|
() => {
|
|
dispatch(conferenceLeft(action.conference));
|
|
dispatch(appNavigate(undefined));
|
|
}
|
|
));
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
return next(action);
|
|
});
|