diff --git a/public/app/plugins/panel/gauge/Thresholds.tsx b/public/app/plugins/panel/gauge/Thresholds.tsx index e066d486842..86ce30c8d21 100644 --- a/public/app/plugins/panel/gauge/Thresholds.tsx +++ b/public/app/plugins/panel/gauge/Thresholds.tsx @@ -33,6 +33,7 @@ export default class Thresholds extends PureComponent { const { thresholds } = this.state; - const newThresholds = thresholds.map(currentThreshold => { - if (currentThreshold === threshold) { - currentThreshold = { ...currentThreshold, value: event.target.value }; + const newThresholds = thresholds.map(t => { + if (t === threshold) { + t = { ...t, value: event.target.value }; } - return currentThreshold; + return t; }); this.setState({ @@ -73,12 +74,12 @@ export default class Thresholds extends PureComponent { const { thresholds } = this.state; - const newThresholds = thresholds.map(currentThreshold => { - if (currentThreshold === threshold) { - currentThreshold = { ...currentThreshold, color: color }; + const newThresholds = thresholds.map(t => { + if (t === threshold) { + t = { ...t, color: color }; } - return currentThreshold; + return t; }); this.setState( @@ -112,11 +113,9 @@ export default class Thresholds extends PureComponent { } componentDidUpdate(prevProps: Props) { - console.log('did update'); this.draw(); } @@ -82,8 +81,6 @@ export class Gauge extends PureComponent { }; }); - console.log(formattedThresholds); - const options = { series: { gauges: {