Skip to content

Commit a2f97cb

Browse files
committed
fix getting scroll target from mapping alignment
1 parent c672afa commit a2f97cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/redux/synopsisMiddleware.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ export const setScrollTarget = (view: WithScrollTarget, textViewId: string): Pos
4646
}
4747
}
4848
// possible by mappingAlignment?
49-
const map = synopsisSlice?.mappingAlignment?.[sourceTextId]?.[targetTextId];
49+
const map = synopsisSlice?.mappingAlignment?.[sourceTextId];
5050
if (map === undefined) return;
5151
for (const sourceSegmentId of sourceSegmentIds) {
5252
if (map.hasOwnProperty(sourceSegmentId)) {
53-
view.scrollTarget = map[sourceSegmentId];
53+
view.scrollTarget = map[sourceSegmentId]?.[targetTextId];
5454
return; // done
5555
}
5656
}

0 commit comments

Comments
 (0)