Skip to content

Commit

Permalink
webfactorymk#75 webfactorymk#75 Fix Bug in Example/LoadFromStorage
Browse files Browse the repository at this point in the history
This fixes a bug where double entries are added to the canvas and updates array in saveFromStorage.
  • Loading branch information
fatihbabacan92 committed Feb 26, 2021
1 parent 4b51545 commit afc88c8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export class AppComponent {
const updates: Array<CanvasWhiteboardUpdate> = parsedStorageUpdates.map(updateJSON =>
CanvasWhiteboardUpdate.deserializeJson(updateJSON));
// Draw the updates onto the canvas
this.canvasWhiteboardService.drawCanvas(updates);
if (this.canvasWhiteboardComponent.getDrawingHistory().length != updates.length) {
this.canvasWhiteboardService.drawCanvas(updates);
}
}
}

Expand Down

0 comments on commit afc88c8

Please sign in to comment.