Skip to content

Commit

Permalink
Filter out old remote shapes whenever new shapes are received.
Browse files Browse the repository at this point in the history
  • Loading branch information
NickLathen committed Oct 31, 2016
1 parent 0302572 commit bfbcade
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/src/app/Board.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ class Board extends React.Component {
for (var key in drawer.data.shapes) {
var shape = drawer.data.shapes[key];
if (shape.guid === serverData.currentShape.guid) {
console.log('async detected');
// console.log('async detected');
async = true;
}
drawer.data.remoteShapes = drawer.data.remoteShapes.filter(function (remoteShape) {
return remoteShape.guid !== shape.guid;
});
}
if (async === false) {
drawer.data.remoteShapes.push(serverData.currentShape);
Expand Down

0 comments on commit bfbcade

Please sign in to comment.