From 489474e9d7251185d24767cbada98df46269ebba Mon Sep 17 00:00:00 2001 From: yznahmad Date: Sat, 21 Jun 2025 04:46:37 +0300 Subject: [PATCH] Add 30 n123456 --- webapp/src/components/dashboard/home/incomeOutcome.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webapp/src/components/dashboard/home/incomeOutcome.tsx b/webapp/src/components/dashboard/home/incomeOutcome.tsx index 2ea9d7a..01a5842 100644 --- a/webapp/src/components/dashboard/home/incomeOutcome.tsx +++ b/webapp/src/components/dashboard/home/incomeOutcome.tsx @@ -11,7 +11,7 @@ export default function IncomeOutcome() { // get needed redux state const report = useAppSelector((state) => state.statisticsReducer.value.report); - const currencySymbol = useAppSelector((state) => state.settingsReducer.value.appGeneralSettings.currencySymbol || '$'); + const settings = useAppSelector((state) => state.settingsReducer.value); const themeType = useAppSelector((state) => state.themeTypeReducer.value.themeType); const [isClient, setIsClient] = useState(false); @@ -27,8 +27,8 @@ export default function IncomeOutcome() setIsClient(true); }, []); - // if loading or no report, don't render the chart - if (!report || !isClient) { + // if loading or no report or settings not loaded, show loading spinner + if (!report || !isClient || !settings?.appGeneralSettings) { return (
@@ -36,6 +36,9 @@ export default function IncomeOutcome() ); } + // Get currency symbol with fallback to '$' if not available + const currencySymbol = settings.appGeneralSettings.currencySymbol || '$'; + // prepare chart data const data = [report?.totalIncome || 0, report?.totalOutcome || 0]; // prepare chart labels