fix(transcriptions): Drops not needed parameter.

Fixes an issue with iFrameAPI where toggleSubtitles will not do anything in case of async transcriptions turned on.
This commit is contained in:
damencho
2025-12-29 11:33:18 -06:00
committed by Дамян Минков
parent 47aa51a58c
commit ddaf7a3180
6 changed files with 12 additions and 17 deletions

View File

@@ -790,7 +790,7 @@ function initCommands() {
} }
if (transcription) { if (transcription) {
APP.store.dispatch(setRequestingSubtitles(true, false, null, true)); APP.store.dispatch(setRequestingSubtitles(true, false, null));
} }
}, },
@@ -812,7 +812,7 @@ function initCommands() {
} }
if (transcription) { if (transcription) {
APP.store.dispatch(setRequestingSubtitles(false, false, null, true)); APP.store.dispatch(setRequestingSubtitles(false, false, null));
} }
if (mode === 'local') { if (mode === 'local') {

View File

@@ -588,7 +588,7 @@ function _registerForNativeEvents(store: IStore) {
} }
if (transcription) { if (transcription) {
store.dispatch(setRequestingSubtitles(true, false, null, true)); store.dispatch(setRequestingSubtitles(true, false, null));
} }
}); });
@@ -603,7 +603,7 @@ function _registerForNativeEvents(store: IStore) {
} }
if (transcription) { if (transcription) {
store.dispatch(setRequestingSubtitles(false, false, null, true)); store.dispatch(setRequestingSubtitles(false, false, null));
} }
if (![ JitsiRecordingConstants.mode.FILE, JitsiRecordingConstants.mode.STREAM ].includes(mode)) { if (![ JitsiRecordingConstants.mode.FILE, JitsiRecordingConstants.mode.STREAM ].includes(mode)) {

View File

@@ -459,7 +459,7 @@ export function showStartRecordingNotificationWithCallback(openRecordingDialog:
}); });
if (autoTranscribeOnRecord) { if (autoTranscribeOnRecord) {
dispatch(setRequestingSubtitles(true, false, null, true)); dispatch(setRequestingSubtitles(true, false, null));
} }
} else { } else {
openRecordingDialog(); openRecordingDialog();

View File

@@ -415,7 +415,7 @@ class AbstractStartRecordingDialog extends Component<IProps, IState> {
if (this.state.selectedRecordingService === RECORDING_TYPES.JITSI_REC_SERVICE if (this.state.selectedRecordingService === RECORDING_TYPES.JITSI_REC_SERVICE
&& this.state.shouldRecordTranscription) { && this.state.shouldRecordTranscription) {
dispatch(setRequestingSubtitles(true, _displaySubtitles, _subtitlesLanguage, true)); dispatch(setRequestingSubtitles(true, _displaySubtitles, _subtitlesLanguage));
} else { } else {
_conference?.getMetadataHandler().setMetadata(RECORDING_METADATA_ID, { _conference?.getMetadataHandler().setMetadata(RECORDING_METADATA_ID, {
isTranscribingEnabled: this.state.shouldRecordTranscription isTranscribingEnabled: this.state.shouldRecordTranscription

View File

@@ -95,11 +95,9 @@ export function toggleRequestingSubtitles() {
export function setRequestingSubtitles( export function setRequestingSubtitles(
enabled: boolean, enabled: boolean,
displaySubtitles = true, displaySubtitles = true,
language: string | null = `translation-languages:${DEFAULT_LANGUAGE}`, language: string | null = `translation-languages:${DEFAULT_LANGUAGE}`) {
backendRecordingOn = false) {
return { return {
type: SET_REQUESTING_SUBTITLES, type: SET_REQUESTING_SUBTITLES,
backendRecordingOn,
displaySubtitles, displaySubtitles,
enabled, enabled,
language language

View File

@@ -98,7 +98,7 @@ MiddlewareRegistry.register(store => next => action => {
break; break;
} }
case SET_REQUESTING_SUBTITLES: case SET_REQUESTING_SUBTITLES:
_requestingSubtitlesChange(store, action.enabled, action.language, action.backendRecordingOn); _requestingSubtitlesChange(store, action.enabled, action.language);
break; break;
} }
@@ -344,17 +344,16 @@ function _getPrimaryLanguageCode(language: string) {
* @param {Store} store - The redux store. * @param {Store} store - The redux store.
* @param {boolean} enabled - Whether subtitles should be enabled or not. * @param {boolean} enabled - Whether subtitles should be enabled or not.
* @param {string} language - The language to use for translation. * @param {string} language - The language to use for translation.
* @param {boolean} backendRecordingOn - Whether backend recording is on or not.
* @private * @private
* @returns {void} * @returns {void}
*/ */
function _requestingSubtitlesChange( function _requestingSubtitlesChange(
{ dispatch, getState }: IStore, { dispatch, getState }: IStore,
enabled: boolean, enabled: boolean,
language?: string | null, language?: string | null) {
backendRecordingOn = false) {
const state = getState(); const state = getState();
const { conference } = state['features/base/conference']; const { conference } = state['features/base/conference'];
const backendRecordingOn = conference?.getMetadataHandler()?.getMetadata()?.asyncTranscription;
conference?.setLocalParticipantProperty( conference?.setLocalParticipantProperty(
P_NAME_REQUESTING_TRANSCRIPTION, P_NAME_REQUESTING_TRANSCRIPTION,
@@ -363,7 +362,7 @@ function _requestingSubtitlesChange(
if (enabled && conference?.getTranscriptionStatus() === JitsiMeetJS.constants.transcriptionStatus.OFF if (enabled && conference?.getTranscriptionStatus() === JitsiMeetJS.constants.transcriptionStatus.OFF
&& isJwtFeatureEnabled(getState(), MEET_FEATURES.TRANSCRIPTION, false)) { && isJwtFeatureEnabled(getState(), MEET_FEATURES.TRANSCRIPTION, false)) {
if (!conference?.getMetadataHandler()?.getMetadata()?.asyncTranscription) { if (!backendRecordingOn) {
conference?.dial(TRANSCRIBER_DIAL_NUMBER) conference?.dial(TRANSCRIBER_DIAL_NUMBER)
.catch((e: any) => { .catch((e: any) => {
logger.error('Error dialing', e); logger.error('Error dialing', e);
@@ -376,9 +375,7 @@ function _requestingSubtitlesChange(
})); }));
dispatch(setSubtitlesError(true)); dispatch(setSubtitlesError(true));
}); });
} } else {
if (backendRecordingOn) {
conference?.getMetadataHandler()?.setMetadata(RECORDING_METADATA_ID, { conference?.getMetadataHandler()?.setMetadata(RECORDING_METADATA_ID, {
isTranscribingEnabled: true isTranscribingEnabled: true
}); });