Skip to content

Commit

Permalink
Merge pull request #147 from bigbluebutton/develop
Browse files Browse the repository at this point in the history
fix(canvases): empty canvas force clean
  • Loading branch information
pedrobmarin authored Oct 5, 2021
2 parents c69843e + b346a4a commit b6e96ad
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/utils/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ const buildCanvases = (group, slides) => {
canvases = group.map(canvas => {
const canvasAttr = getAttr(canvas);
const canvasId = getId(canvasAttr.id);
const { timestamp } = slides.find(slide => slide.id === canvasId);

let data = canvas.g.map(g => {
const drawAttr = getAttr(g);
Expand Down Expand Up @@ -310,11 +309,25 @@ const buildCanvases = (group, slides) => {
return {
data,
id: canvasId,
timestamp,
};
});
}

slides.forEach((slide, index) => {
const found = canvases.find(canvas => canvas.id === slide.id);
if (found) {
canvases[index].timestamp = slide.timestamp;
} else {
const canvas = {
data: [],
id: slide.id,
timestamp: slide.timestamp,
};

canvases.splice(index, 0, canvas);
}
});

return canvases;
};

Expand Down

0 comments on commit b6e96ad

Please sign in to comment.