Skip to content

Commit

Permalink
Consolidate if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Oct 20, 2023
1 parent 3e60074 commit fff1d72
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions webapp/src/blocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,8 @@ export class Editor extends toolboxeditor.ToolboxEditor {
}
else if (ev.type === Blockly.Events.VIEWPORT_CHANGE) {
const viewportChangeEvent = ev as Blockly.Events.ViewportChange;
if (this.initialScaleSet && viewportChangeEvent.oldScale !== viewportChangeEvent.scale) {
if (this.onScaleChanged) {
this.onScaleChanged(viewportChangeEvent.oldScale, viewportChangeEvent.scale);
}
if (this.initialScaleSet && viewportChangeEvent.oldScale !== viewportChangeEvent.scale && this.onScaleChanged) {
this.onScaleChanged(viewportChangeEvent.oldScale, viewportChangeEvent.scale);
}
this.initialScaleSet = true;
}
Expand Down

0 comments on commit fff1d72

Please sign in to comment.