Skip to content

Commit

Permalink
Add comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoldowsky committed Sep 20, 2024
1 parent c9a5a94 commit 5ad1167
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/data-card/data-card-tile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export const DataCardToolComponent: React.FC<ITileProps> = observer(function Dat
const selectedCaseId = dataSet.firstSelectedCaseId !== undefined
? dataSet.firstSelectedCaseId : dataSet.firstSelectedCell?.caseId;
useEffect(() => {
// caseIndex is undefined when the tile is first created.
// The initial setting of this field must be handled `updateAfterSharedModelChanges`,
// so that it is part of the same history entry as the tile creation. Setting it here would mean
// creating a second history entry that might be out of order.
if (content.caseIndex === undefined) return;
if (selectedCaseId !== undefined && dataSet.caseIndexFromID(selectedCaseId) !== content.caseIndex) {
content.setCaseIndex(dataSet.caseIndexFromID(selectedCaseId));
Expand Down

0 comments on commit 5ad1167

Please sign in to comment.