fix(transcribing) fix overriding transcribing state

Skip updating the transcribing state when the 'audio-recording-enabled'
property is not provided.

This fixes a race when a transcriber is already in the room, we'll see
it before properties are updated (sometimes) and without checking for
undefined we'd flip the local value to false.
This commit is contained in:
Saúl Ibarra Corretgé
2025-07-04 15:20:09 +02:00
committed by Saúl Ibarra Corretgé
parent 6141ff78f8
commit d2ed9ffef6

View File

@@ -46,13 +46,17 @@ ReducerRegistry.register<ITranscribingState>('features/transcribing',
(state = _getInitialState(), action): ITranscribingState => {
switch (action.type) {
case CONFERENCE_PROPERTIES_CHANGED: {
const audioRecordingEnabled = action.properties?.['audio-recording-enabled'] === 'true';
const audioRecording = action.properties?.['audio-recording-enabled'];
if (state.isTranscribing !== audioRecordingEnabled) {
return {
...state,
isTranscribing: audioRecordingEnabled
};
if (typeof audioRecording !== 'undefined') {
const audioRecordingEnabled = audioRecording === 'true';
if (state.isTranscribing !== audioRecordingEnabled) {
return {
...state,
isTranscribing: audioRecordingEnabled
};
}
}
return state;