Skip to content

Commit

Permalink
Merge pull request #251 from GuiLeme/issue-18721
Browse files Browse the repository at this point in the history
fix: whiteboard annotations appearing in all slides.
  • Loading branch information
antobinary authored Sep 15, 2023
2 parents 71cbfdd + a36b76a commit 9926660
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/components/tldraw/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const intlMessages = defineMessages({
},
});

const getTldrawData = (index) => storage.tldraw[index].data;
const getTldrawData = (index, pageNumber) => storage.tldraw[index].id === pageNumber.toString()
? storage.tldraw[index].data : [];
const getTldrawBbbVersion = (index) => storage.tldraw[index]?.bbb_version;

const SlideData = (tldrawAPI) => {
Expand Down Expand Up @@ -103,14 +104,16 @@ const SlideData = (tldrawAPI) => {
for (let i = 0; i < interval.length; i++) {
if (!interval[i]) continue;

const tldrawData = getTldrawData(index);
const tldrawData = getTldrawData(index, id);

const {
shape,
} = tldrawData[i];

shape.parentId = tldrawAPI?.currentPageId;
shapes[shape.id] = shape;
if (tldrawData[i]) {
const {
shape,
} = tldrawData[i];

shape.parentId = tldrawAPI?.currentPageId;
shapes[shape.id] = shape;
}
}

return { assets, shapes, scaleRatio }
Expand Down

0 comments on commit 9926660

Please sign in to comment.