mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-02-25 07:10:22 +00:00
* fix: Drop duplicate call of wait for owner. * fix: Fixes leaking listeners while waiting for host to join. While waiting for the host to join on the dialog we attempt to join over and over again till we are admitted to enter the meeting. While doing that authRequired flag is on, and we were adding listeners on and on. * feat: Introduces conference join in progress action. This event is coming from lib-jitsi-meet and is fired when we receive the first presence of series when joining. It is always fired before joined event. * fix: Moves testing middleware to use CONFERENCE_JOIN_IN_PROGRESS. * fix: Moves follow-me middleware to use CONFERENCE_JOIN_IN_PROGRESS. * fix: Moves some polls logic to middleware and use CONFERENCE_JOIN_IN_PROGRESS. * fix: Moves reactions middleware to use CONFERENCE_JOIN_IN_PROGRESS. * fix: Moves recordings middleware to use CONFERENCE_JOIN_IN_PROGRESS. * fix: Moves shared-video middleware to use CONFERENCE_JOIN_IN_PROGRESS. * fix: Moves videosipgw middleware to use CONFERENCE_JOIN_IN_PROGRESS. * squash: Fix comments. * fix: Fixes join in progress on web. * fix: Moves variable extraction inside handlers. * fix: Moves variable extraction inside handlers again. * fix: Moves etherpad middleware to use CONFERENCE_JOIN_IN_PROGRESS.
65 lines
1.9 KiB
JavaScript
65 lines
1.9 KiB
JavaScript
// @flow
|
|
|
|
import UIEvents from '../../../service/UI/UIEvents';
|
|
import { getCurrentConference } from '../base/conference';
|
|
import { CONFERENCE_JOIN_IN_PROGRESS } from '../base/conference/actionTypes';
|
|
import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
|
|
|
|
import { TOGGLE_DOCUMENT_EDITING } from './actionTypes';
|
|
import { setDocumentUrl } from './actions';
|
|
|
|
declare var APP: Object;
|
|
|
|
const ETHERPAD_COMMAND = 'etherpad';
|
|
|
|
/**
|
|
* Middleware that captures actions related to collaborative document editing
|
|
* and notifies components not hooked into redux.
|
|
*
|
|
* @param {Store} store - The redux store.
|
|
* @returns {Function}
|
|
*/
|
|
// eslint-disable-next-line no-unused-vars
|
|
MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
|
switch (action.type) {
|
|
case CONFERENCE_JOIN_IN_PROGRESS: {
|
|
const { conference } = action;
|
|
|
|
conference.addCommandListener(ETHERPAD_COMMAND,
|
|
({ value }) => {
|
|
let url;
|
|
const { etherpad_base: etherpadBase } = getState()['features/base/config'];
|
|
|
|
if (etherpadBase) {
|
|
url = new URL(value, etherpadBase).toString();
|
|
}
|
|
|
|
dispatch(setDocumentUrl(url));
|
|
}
|
|
);
|
|
break;
|
|
}
|
|
case TOGGLE_DOCUMENT_EDITING: {
|
|
if (typeof APP !== 'undefined') {
|
|
APP.UI.emitEvent(UIEvents.ETHERPAD_CLICKED);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
return next(action);
|
|
});
|
|
|
|
/**
|
|
* Set up state change listener to perform maintenance tasks when the conference
|
|
* is left or failed, e.g. Clear messages or close the chat modal if it's left
|
|
* open.
|
|
*/
|
|
StateListenerRegistry.register(
|
|
state => getCurrentConference(state),
|
|
(conference, { dispatch }, previousConference) => {
|
|
if (previousConference) {
|
|
dispatch(setDocumentUrl(undefined));
|
|
}
|
|
});
|