2022-10-07 09:16:41 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2022-10-04 09:44:48 +00:00
|
|
|
import ChatPrivacyDialog from '../../chat/components/web/ChatPrivacyDialog';
|
|
|
|
import DisplayNamePrompt from '../../display-name/components/web/DisplayNamePrompt';
|
|
|
|
import EmbedMeetingDialog from '../../embed-meeting/components/EmbedMeetingDialog';
|
2022-10-07 09:16:41 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import FeedbackDialog from '../../feedback/components/FeedbackDialog.web';
|
|
|
|
import AddPeopleDialog from '../../invite/components/add-people-dialog/web/AddPeopleDialog';
|
|
|
|
import PremiumFeatureDialog from '../../jaas/components/web/PremiumFeatureDialog';
|
2022-10-04 09:44:48 +00:00
|
|
|
import KeyboardShortcutsDialog from '../../keyboard-shortcuts/components/web/KeyboardShortcutsDialog';
|
2022-10-07 09:16:41 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import StartLiveStreamDialog from '../../recording/components/LiveStream/web/StartLiveStreamDialog';
|
|
|
|
// @ts-ignore
|
|
|
|
import StopLiveStreamDialog from '../../recording/components/LiveStream/web/StopLiveStreamDialog';
|
|
|
|
// @ts-ignore
|
|
|
|
import StartRecordingDialog from '../../recording/components/Recording/web/StartRecordingDialog';
|
|
|
|
// @ts-ignore
|
|
|
|
import StopRecordingDialog from '../../recording/components/Recording/web/StopRecordingDialog';
|
|
|
|
import ShareAudioDialog from '../../screen-share/components/ShareAudioDialog';
|
2022-10-10 09:12:02 +00:00
|
|
|
import ShareScreenWarningDialog from '../../screen-share/components/ShareScreenWarningDialog';
|
|
|
|
import SecurityDialog from '../../security/components/security-dialog/web/SecurityDialog';
|
|
|
|
import SharedVideoDialog from '../../shared-video/components/web/SharedVideoDialog';
|
|
|
|
import SpeakerStats from '../../speaker-stats/components/web/SpeakerStats';
|
|
|
|
import LanguageSelectorDialog from '../../subtitles/components/LanguageSelectorDialog.web';
|
2022-10-11 08:24:11 +00:00
|
|
|
import GrantModeratorDialog from '../../video-menu/components/web/GrantModeratorDialog';
|
|
|
|
import KickRemoteParticipantDialog from '../../video-menu/components/web/KickRemoteParticipantDialog';
|
2022-10-10 09:12:02 +00:00
|
|
|
import MuteEveryoneDialog from '../../video-menu/components/web/MuteEveryoneDialog';
|
|
|
|
import MuteEveryonesVideoDialog from '../../video-menu/components/web/MuteEveryonesVideoDialog';
|
2022-10-11 08:24:11 +00:00
|
|
|
import MuteRemoteParticipantsVideoDialog from '../../video-menu/components/web/MuteRemoteParticipantsVideoDialog';
|
|
|
|
// @ts-ignore
|
|
|
|
import VideoQualityDialog from '../../video-quality/components/VideoQualityDialog.web';
|
|
|
|
import VirtualBackgroundDialog from '../../virtual-background/components/VirtualBackgroundDialog';
|
2022-10-04 09:44:48 +00:00
|
|
|
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
|
|
|
|
|
|
|
|
import { OPEN_DIALOG } from './actionTypes';
|
|
|
|
|
|
|
|
// ! IMPORTANT - This whole middleware is only needed for the transition from from @atlaskit dialog to our component.
|
|
|
|
// ! It should be removed when the transition is over.
|
|
|
|
|
2022-10-07 09:16:41 +00:00
|
|
|
const NEW_DIALOG_LIST = [ KeyboardShortcutsDialog, ChatPrivacyDialog, DisplayNamePrompt, EmbedMeetingDialog,
|
|
|
|
FeedbackDialog, AddPeopleDialog, PremiumFeatureDialog, StartLiveStreamDialog, StopLiveStreamDialog,
|
2022-10-10 09:12:02 +00:00
|
|
|
StartRecordingDialog, StopRecordingDialog, ShareAudioDialog, ShareScreenWarningDialog, SecurityDialog,
|
2022-10-11 08:24:11 +00:00
|
|
|
SharedVideoDialog, SpeakerStats, LanguageSelectorDialog, MuteEveryoneDialog, MuteEveryonesVideoDialog,
|
|
|
|
GrantModeratorDialog, KickRemoteParticipantDialog, MuteRemoteParticipantsVideoDialog, VideoQualityDialog,
|
|
|
|
VirtualBackgroundDialog ];
|
2022-10-04 09:44:48 +00:00
|
|
|
|
|
|
|
// This function is necessary while the transition from @atlaskit dialog to our component is ongoing.
|
|
|
|
const isNewDialog = (component: any) => NEW_DIALOG_LIST.some(comp => comp === component);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements the entry point of the middleware of the feature base/media.
|
|
|
|
*
|
|
|
|
* @param {IStore} store - The redux store.
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
MiddlewareRegistry.register(() => (next: Function) => (action: any) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case OPEN_DIALOG: {
|
|
|
|
action.isNewDialog = isNewDialog(action.component);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return next(action);
|
|
|
|
});
|