Skip to content
Snippets Groups Projects
Commit 4b858721 authored by Dima Rifai's avatar Dima Rifai
Browse files

Check if empty or not before slice

parent b199a2dd
No related branches found
No related tags found
1 merge request!507Delrifai/#394 2 add charts to balance history
......@@ -162,7 +162,7 @@ export default function BalanceHistory() {
// Use useMemo to memoize the prepared data so it only recalculates when chartData changes
const preparedData = useMemo(() => {
return chartData ? prepareData(chartData.operations_result.slice().reverse()) : [];
return chartData ? prepareData(chartData.operations_result?.slice().reverse()) : [];
}, [chartData]); // This will only recompute when chartData changes
let message = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment