mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
* ref: improve handling for room destroyed events * add missing translation * code review * implement kick handling * implement native handling * fix tests * code review changes * add dialog testId * fix end conf for react native * fix lobby test * add translation for lobby closing --------- Co-authored-by: Gabriel Borlea <gabriel.borlea@8x8.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { appNavigate } from '../../app/actions.native';
|
|
import { notifyConferenceFailed } from '../../conference/actions.native';
|
|
import { JitsiConferenceErrors } from '../lib-jitsi-meet';
|
|
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
|
|
|
|
import { CONFERENCE_FAILED } from './actionTypes';
|
|
import { conferenceLeft } from './actions';
|
|
import { TRIGGER_READY_TO_CLOSE_REASONS } from './constants';
|
|
|
|
import './middleware.any';
|
|
|
|
MiddlewareRegistry.register(store => next => action => {
|
|
const { dispatch } = store;
|
|
const { error } = action;
|
|
|
|
switch (action.type) {
|
|
case CONFERENCE_FAILED: {
|
|
if (error?.name !== JitsiConferenceErrors.CONFERENCE_DESTROYED) {
|
|
break;
|
|
}
|
|
|
|
const [ reason ] = error.params;
|
|
|
|
const reasonKey = Object.keys(TRIGGER_READY_TO_CLOSE_REASONS)[
|
|
Object.values(TRIGGER_READY_TO_CLOSE_REASONS).indexOf(reason)
|
|
];
|
|
|
|
dispatch(notifyConferenceFailed(reasonKey, () => {
|
|
dispatch(conferenceLeft(action.conference));
|
|
dispatch(appNavigate(undefined));
|
|
}));
|
|
}
|
|
}
|
|
|
|
return next(action);
|
|
});
|