snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
33
react/features/settings/middleware.web.ts
Normal file
33
react/features/settings/middleware.web.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
|
||||
import { SETTINGS_UPDATED } from '../base/settings/actionTypes';
|
||||
import { getHideSelfView } from '../base/settings/functions.web';
|
||||
import { showNotification } from '../notifications/actions';
|
||||
import { DISABLE_SELF_VIEW_NOTIFICATION_ID, NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
|
||||
|
||||
import { openSettingsDialog } from './actions';
|
||||
import { SETTINGS_TABS } from './constants';
|
||||
|
||||
MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
||||
const oldValue = getHideSelfView(getState());
|
||||
|
||||
const result = next(action);
|
||||
|
||||
switch (action.type) {
|
||||
case SETTINGS_UPDATED: {
|
||||
const newValue = action.settings.disableSelfView;
|
||||
|
||||
if (newValue !== oldValue && newValue) {
|
||||
dispatch(showNotification({
|
||||
uid: DISABLE_SELF_VIEW_NOTIFICATION_ID,
|
||||
titleKey: 'notify.selfViewTitle',
|
||||
customActionNameKey: [ 'settings.title' ],
|
||||
customActionHandler: [ () =>
|
||||
dispatch(openSettingsDialog(SETTINGS_TABS.MORE))
|
||||
]
|
||||
}, NOTIFICATION_TIMEOUT_TYPE.STICKY));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
Reference in New Issue
Block a user