Skip to content

Commit 26be5ac

Browse files
committed
save perfView
1 parent 5161f65 commit 26be5ac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/app/components/PerfView.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-plusplus */
12
/* eslint-disable func-names */
23
/* eslint-disable react/no-this-in-sfc */
34
/* eslint-disable no-shadow */
@@ -30,7 +31,7 @@ import { addNewSnapshots } from '../actions/actions';
3031
// }, [windowRef]);
3132

3233
const PerfView = ({ snapshots, viewIndex }) => {
33-
const [chartData, setChartData] = useState(snapshots[snapshots.length - 1]);
34+
const [chartData, updateChartData] = useState(snapshots[snapshots.length - 1]);
3435
const svgRef = useRef(null);
3536

3637
// Todo: implement update functions...
@@ -72,10 +73,10 @@ const PerfView = ({ snapshots, viewIndex }) => {
7273
}
7374

7475
if (viewIndex < 0) {
75-
setChartData(snapshots[snapshots.length - 1]);
76+
updateChartData(snapshots[snapshots.length - 1]);
7677
console.log(`Using snapshots[${snapshots.length - 1}]`);
7778
} else {
78-
setChartData(snapshots[viewIndex]);
79+
updateChartData(snapshots[viewIndex]);
7980
console.log(`Using snapshots[${viewIndex}]`);
8081
}
8182

0 commit comments

Comments
 (0)