Files
jitsi-meet/react/features/transcribing/middleware.ts
damencho 0387cdc888 feat(notifications): Make all error notifications sticky.
There are many cases where the error disappears and users easily miss the information.
2025-02-10 06:17:50 -06:00

26 lines
665 B
TypeScript

import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { showErrorNotification } from '../notifications/actions';
import { TRANSCRIBER_LEFT } from './actionTypes';
import './subscriber';
/**
* Implements the middleware of the feature transcribing.
*
* @param {Store} store - The redux store.
* @returns {Function}
*/
MiddlewareRegistry.register(({ dispatch }) => next => action => {
switch (action.type) {
case TRANSCRIBER_LEFT:
if (action.abruptly) {
dispatch(showErrorNotification({
titleKey: 'transcribing.failed'
}));
}
break;
}
return next(action);
});