Skip to content

Commit 6118cfa

Browse files
committed
Code cleanup
1 parent 017f924 commit 6118cfa

File tree

1 file changed

+3
-4
lines changed
  • src/lib/TranscriptEditor/TimedTextEditor

1 file changed

+3
-4
lines changed

src/lib/TranscriptEditor/TimedTextEditor/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,15 +501,14 @@ class TimedTextEditor extends React.Component {
501501
const blockKey = currentBlock.key;
502502
const ranges = currentBlock.entityRanges;
503503

504-
for (var idx in ranges) {
505-
const range = ranges[idx];
504+
for (var rangeIdx in ranges) {
505+
const range = ranges[rangeIdx];
506506
// Need to access entityMap and not currentBlock.data.words, as it seems to be not in sync with edits.
507507
const word = entityMap[range.key].data;
508508

509509
if (word.start <= this.props.currentTime) {
510510
currentFocus.blockKey = blockKey;
511511
currentFocus.offset = range.offset + range.length;
512-
currentFocus.start = word.start;
513512
} else {
514513
break;
515514
}
@@ -527,9 +526,9 @@ class TimedTextEditor extends React.Component {
527526
const selectionState = this.state.editorState.getSelection();
528527
const selection = selectionState.merge({
529528
anchorOffset: currentFocus.offset,
529+
anchorKey: currentFocus.blockKey,
530530
focusOffset: currentFocus.offset,
531531
focusKey: currentFocus.blockKey,
532-
anchorKey: currentFocus.blockKey,
533532
});
534533

535534
const newState = EditorState.forceSelection(this.state.editorState, selection);

0 commit comments

Comments
 (0)