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

Commit 0c17dfb

Browse files
committed
Move logging to inside conditional
1 parent 1094d95 commit 0c17dfb

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/components/Steps.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ var Steps = function (_Component) {
6060
}, {
6161
key: "componentDidUpdate",
6262
value: function componentDidUpdate(prevProps) {
63-
(0, _log2.default)("Updated steps", {
64-
oldSteps: this.getSteps(prevProps.children),
65-
newSteps: this.getSteps()
66-
});
67-
6863
if (this.getSteps(prevProps.children).length !== this.getSteps().length) {
64+
(0, _log2.default)("Updated steps", {
65+
oldSteps: this.getSteps(prevProps.children),
66+
newSteps: this.getSteps()
67+
});
6968
this.context.wizard.setSteps(this.getSteps());
7069
}
7170
}

src/components/Steps.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ class Steps extends Component {
2323
}
2424

2525
componentDidUpdate(prevProps) {
26-
log("Updated steps", {
27-
oldSteps: this.getSteps(prevProps.children),
28-
newSteps: this.getSteps(),
29-
});
30-
3126
if (this.getSteps(prevProps.children).length !== this.getSteps().length) {
27+
log("Updated steps", {
28+
oldSteps: this.getSteps(prevProps.children),
29+
newSteps: this.getSteps(),
30+
});
3231
this.context.wizard.setSteps(this.getSteps());
3332
}
3433
}

0 commit comments

Comments
 (0)