Skip to content

Commit

Permalink
feat(subtitles): review remark
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinteodor committed Mar 28, 2024
1 parent 1ae7097 commit 4587d93
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions react/features/subtitles/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,22 @@ function _endpointMessageReceived(store: IStore, next: Function, action: AnyActi
store
);

// Dump transcript in a <transcript> element for debugging purposes.
if (!json.is_interim && dumpTranscript) {
try {
let elem = document.body.getElementsByTagName('transcript')[0];

if (!elem) {
elem = document.createElement('transcript');
document.body.appendChild(elem);
}
if (navigator.product !== 'ReactNative') {

// Dump transcript in a <transcript> element for debugging purposes.
if (!json.is_interim && dumpTranscript) {
try {
let elem = document.body.getElementsByTagName('transcript')[0];

elem.append(`${new Date(json.timestamp).toISOString()} ${participant.name}: ${text}`);
} catch (_) {
// Ignored.
if (!elem) {

Check failure on line 161 in react/features/subtitles/middleware.ts

View workflow job for this annotation

GitHub Actions / Lint

Blocks are nested too deeply (5). Maximum allowed is 4
elem = document.createElement('transcript');
document.body.appendChild(elem);
}

elem.append(`${new Date(json.timestamp).toISOString()} ${participant.name}: ${text}`);
} catch (_) {
// Ignored.
}
}
}
}
Expand Down

0 comments on commit 4587d93

Please sign in to comment.