Skip to content

Commit 58aa47d

Browse files
committed
Cleanup componentDidUpdate
1 parent 3cd5e86 commit 58aa47d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/components/ymd-timestamp-header.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ export default class YmdTimestampHeader extends React.Component {
7676
componentDidUpdate () {
7777
if ((this.state.leftSnaps || this.state.rightSnaps) && !this.state.showError) {
7878
this._selectValues();
79-
if (this.state.sparkline && !this.state.leftMonthOptions && !this.state.rightMonthOptions) {
80-
if (this.state.leftMonthIndex !== -1 || this.state.rightMonthIndex !== -1) {
81-
this._showMonths(this.state.leftYear, this.state.rightYear);
82-
}
83-
}
8479
}
8580
}
8681

@@ -333,6 +328,12 @@ export default class YmdTimestampHeader extends React.Component {
333328
}
334329
this._selectMonth(this.monthSelectLeft.current, this.state.leftMonthIndex);
335330
this._selectMonth(this.monthSelectRight.current, this.state.rightMonthIndex);
331+
332+
if (this.state.sparkline && !this.state.leftMonthOptions && !this.state.rightMonthOptions) {
333+
if (this.state.leftMonthIndex !== -1 || this.state.rightMonthIndex !== -1) {
334+
this._showMonths(this.state.leftYear, this.state.rightYear);
335+
}
336+
}
336337
};
337338

338339
_selectMonth = (monthSelect, monthIndex) => {

0 commit comments

Comments
 (0)