Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Move logging to inside conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
skoshy committed Aug 18, 2020
1 parent 1094d95 commit 0c17dfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions lib/components/Steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ var Steps = function (_Component) {
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
(0, _log2.default)("Updated steps", {
oldSteps: this.getSteps(prevProps.children),
newSteps: this.getSteps()
});

if (this.getSteps(prevProps.children).length !== this.getSteps().length) {
(0, _log2.default)("Updated steps", {
oldSteps: this.getSteps(prevProps.children),
newSteps: this.getSteps()
});
this.context.wizard.setSteps(this.getSteps());
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/components/Steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ class Steps extends Component {
}

componentDidUpdate(prevProps) {
log("Updated steps", {
oldSteps: this.getSteps(prevProps.children),
newSteps: this.getSteps(),
});

if (this.getSteps(prevProps.children).length !== this.getSteps().length) {
log("Updated steps", {
oldSteps: this.getSteps(prevProps.children),
newSteps: this.getSteps(),
});
this.context.wizard.setSteps(this.getSteps());
}
}
Expand Down

0 comments on commit 0c17dfb

Please sign in to comment.