Skip to content

Commit 373f50e

Browse files
LInting fixes
1 parent 14b234a commit 373f50e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/ui/widgets/EmbeddedDisplay/bobParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ function bobParseChildProps(props: any): any {
311311
// For each prop, convert the name and parse
312312
const newName = snakeCaseToCamelCase(key);
313313
if (newName && BOB_SIMPLE_PARSERS.hasOwnProperty(newName)) {
314-
const [opiPropName, propParser] = BOB_SIMPLE_PARSERS[newName];
314+
const [, propParser] = BOB_SIMPLE_PARSERS[newName];
315315
obj[newName] = propParser(value);
316316
}
317317
});

src/ui/widgets/StripChart/stripChart.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ export const StripChartComponent = (
6363
scaleFont = new Font(),
6464
labelFont = new Font(),
6565
showGrid = false,
66-
showToolbar = true,
6766
showLegend = false,
6867
foregroundColor = Color.fromRgba(0, 0, 0, 1),
6968
backgroundColor = Color.fromRgba(255, 255, 255, 1),
7069
start = "1 minute",
71-
end,
7270
visible = true
7371
} = props;
7472

@@ -86,17 +84,19 @@ export const StripChartComponent = (
8684
// rRemove data outside min and max bounds
8785
const minimum = new Date(new Date().getTime() - timePeriod);
8886
// Check if first data point in array is outside minimum, if so remove
89-
const xData = [...data.x];
90-
const yData = [...data.y];
91-
if (data.x.length > 0 && data.x[0].getTime() < minimum.getTime()) {
92-
xData.shift();
93-
yData.shift();
94-
}
95-
setData({
96-
x: [...xData, value.getTime()?.datetime],
97-
y: [...yData, value.getDoubleValue()],
98-
min: minimum,
99-
max: new Date()
87+
setData(currentData => {
88+
const xData = currentData.x;
89+
const yData = currentData.y;
90+
if (xData.length > 0 && xData[0].getTime() < minimum.getTime()) {
91+
xData.shift();
92+
yData.shift();
93+
}
94+
return {
95+
x: [...xData, value.getTime()?.datetime],
96+
y: [...yData, value.getDoubleValue()],
97+
min: minimum,
98+
max: new Date()
99+
};
100100
});
101101
}
102102
}, [value, timePeriod]);

0 commit comments

Comments
 (0)