mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
* fix(subtitles): Handle errors to revert to default state. * fix(transcribing): Handle transcriber status changed. Drops potential transcribers and hidden participant actions and handling. Expect ljm to detect transcriptions on and off. * feat(transcriptions): Adds a notification if transcriber leaves abruptly. * squash: Renames action. * chore(deps) lib-jitsi-meet@latest https://github.com/jitsi/lib-jitsi-meet/compare/v1869.0.0+5671c5d6...v1872.0.0+8940b5c9
63 lines
1.4 KiB
TypeScript
63 lines
1.4 KiB
TypeScript
import ReducerRegistry from '../base/redux/ReducerRegistry';
|
|
|
|
import {
|
|
TRANSCRIBER_JOINED,
|
|
TRANSCRIBER_LEFT
|
|
} from './actionTypes';
|
|
|
|
/**
|
|
* Returns initial state for transcribing feature part of Redux store.
|
|
*
|
|
* @returns {{
|
|
* isTranscribing: boolean,
|
|
* transcriberJID: null
|
|
* }}
|
|
* @private
|
|
*/
|
|
function _getInitialState() {
|
|
return {
|
|
/**
|
|
* Indicates whether there is currently an active transcriber in the
|
|
* room.
|
|
*
|
|
* @type {boolean}
|
|
*/
|
|
isTranscribing: false,
|
|
|
|
/**
|
|
* The JID of the active transcriber.
|
|
*
|
|
* @type { string }
|
|
*/
|
|
transcriberJID: null
|
|
};
|
|
}
|
|
|
|
export interface ITranscribingState {
|
|
isTranscribing: boolean;
|
|
transcriberJID?: string | null;
|
|
}
|
|
|
|
/**
|
|
* Reduces the Redux actions of the feature features/transcribing.
|
|
*/
|
|
ReducerRegistry.register<ITranscribingState>('features/transcribing',
|
|
(state = _getInitialState(), action): ITranscribingState => {
|
|
switch (action.type) {
|
|
case TRANSCRIBER_JOINED:
|
|
return {
|
|
...state,
|
|
isTranscribing: true,
|
|
transcriberJID: action.transcriberJID
|
|
};
|
|
case TRANSCRIBER_LEFT:
|
|
return {
|
|
...state,
|
|
isTranscribing: false,
|
|
transcriberJID: undefined
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
});
|