parent
51b827ebb0
commit
0e9b40c410
|
@ -8,6 +8,7 @@ import '../external-api/middleware';
|
||||||
import '../keyboard-shortcuts/middleware';
|
import '../keyboard-shortcuts/middleware';
|
||||||
import '../local-recording/middleware';
|
import '../local-recording/middleware';
|
||||||
import '../no-audio-signal/middleware';
|
import '../no-audio-signal/middleware';
|
||||||
|
import '../notifications/middleware';
|
||||||
import '../noise-detection/middleware';
|
import '../noise-detection/middleware';
|
||||||
import '../old-client-notification/middleware';
|
import '../old-client-notification/middleware';
|
||||||
import '../power-monitor/middleware';
|
import '../power-monitor/middleware';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import { CONFERENCE_JOINED, getCurrentConference } from '../base/conference';
|
import { getCurrentConference } from '../base/conference';
|
||||||
import {
|
import {
|
||||||
PARTICIPANT_JOINED,
|
PARTICIPANT_JOINED,
|
||||||
PARTICIPANT_LEFT,
|
PARTICIPANT_LEFT,
|
||||||
|
@ -12,7 +12,6 @@ import {
|
||||||
} from '../base/participants';
|
} from '../base/participants';
|
||||||
import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
|
import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
|
||||||
import { PARTICIPANTS_PANE_OPEN } from '../participants-pane/actionTypes';
|
import { PARTICIPANTS_PANE_OPEN } from '../participants-pane/actionTypes';
|
||||||
import { openSettingsDialog, SETTINGS_TABS } from '../settings';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
clearNotifications,
|
clearNotifications,
|
||||||
|
@ -32,21 +31,6 @@ import { joinLeaveNotificationsDisabled } from './functions';
|
||||||
*/
|
*/
|
||||||
MiddlewareRegistry.register(store => next => action => {
|
MiddlewareRegistry.register(store => next => action => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case CONFERENCE_JOINED: {
|
|
||||||
const { dispatch, getState } = store;
|
|
||||||
const { disableSelfView } = getState()['features/base/settings'];
|
|
||||||
|
|
||||||
if (disableSelfView) {
|
|
||||||
dispatch(showNotification({
|
|
||||||
titleKey: 'notify.selfViewTitle',
|
|
||||||
customActionNameKey: [ 'settings.title' ],
|
|
||||||
customActionHandler: [ () =>
|
|
||||||
dispatch(openSettingsDialog(SETTINGS_TABS.PROFILE))
|
|
||||||
]
|
|
||||||
}, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PARTICIPANT_JOINED: {
|
case PARTICIPANT_JOINED: {
|
||||||
const result = next(action);
|
const result = next(action);
|
||||||
const { participant: p } = action;
|
const { participant: p } = action;
|
|
@ -0,0 +1 @@
|
||||||
|
import './middleware.any';
|
|
@ -0,0 +1,40 @@
|
||||||
|
/* @flow */
|
||||||
|
|
||||||
|
import { CONFERENCE_JOINED } from '../base/conference';
|
||||||
|
import { MiddlewareRegistry } from '../base/redux';
|
||||||
|
import { openSettingsDialog, SETTINGS_TABS } from '../settings';
|
||||||
|
|
||||||
|
import {
|
||||||
|
showNotification
|
||||||
|
} from './actions';
|
||||||
|
import { NOTIFICATION_TIMEOUT_TYPE } from './constants';
|
||||||
|
|
||||||
|
import './middleware.any';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Middleware that captures actions to display notifications.
|
||||||
|
*
|
||||||
|
* @param {Store} store - The redux store.
|
||||||
|
* @returns {Function}
|
||||||
|
*/
|
||||||
|
MiddlewareRegistry.register(store => next => action => {
|
||||||
|
switch (action.type) {
|
||||||
|
case CONFERENCE_JOINED: {
|
||||||
|
const { dispatch, getState } = store;
|
||||||
|
const { disableSelfView } = getState()['features/base/settings'];
|
||||||
|
|
||||||
|
if (disableSelfView) {
|
||||||
|
dispatch(showNotification({
|
||||||
|
titleKey: 'notify.selfViewTitle',
|
||||||
|
customActionNameKey: [ 'settings.title' ],
|
||||||
|
customActionHandler: [ () =>
|
||||||
|
dispatch(openSettingsDialog(SETTINGS_TABS.PROFILE))
|
||||||
|
]
|
||||||
|
}, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return next(action);
|
||||||
|
});
|
Loading…
Reference in New Issue