From 465911039cbb25c48a2fbf08fa4d52f20cc4206e Mon Sep 17 00:00:00 2001 From: Ryan Lynch Date: Mon, 29 Jul 2024 23:16:16 +0100 Subject: [PATCH] Fixing local storage bug when user makes fee empty and refreshes page. --- src/components/FeesPanel/FeesPanel.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/FeesPanel/FeesPanel.tsx b/src/components/FeesPanel/FeesPanel.tsx index f143aad..ccb257c 100644 --- a/src/components/FeesPanel/FeesPanel.tsx +++ b/src/components/FeesPanel/FeesPanel.tsx @@ -38,7 +38,7 @@ export const FeesPanel: React.FC = (props: FeesPanelProps) => { label="Valuation Fee" prefix="€" type="number" - value={fees.valuationFee.toString()} + value={fees.valuationFee?.toString()} onChange={(_, newValue) => setFees({ ...fees, @@ -51,7 +51,7 @@ export const FeesPanel: React.FC = (props: FeesPanelProps) => { label="Survey Fee" prefix="€" type="number" - value={fees.surveyFee.toString()} + value={fees.surveyFee?.toString()} onChange={(_, newValue) => setFees({ ...fees, @@ -84,7 +84,7 @@ export const FeesPanel: React.FC = (props: FeesPanelProps) => { root: { marginTop: "0.5rem !important" }, }} type="number" - value={fees.legalFee.toString()} + value={fees.legalFee?.toString()} onChange={(_, newValue) => setFees({ ...fees, @@ -97,7 +97,7 @@ export const FeesPanel: React.FC = (props: FeesPanelProps) => { label="Law Searches Fee" prefix="€" type="number" - value={fees.searchFee.toString()} + value={fees.searchFee?.toString()} onChange={(_, newValue) => setFees({ ...fees, @@ -110,7 +110,7 @@ export const FeesPanel: React.FC = (props: FeesPanelProps) => { label="Register of Deeds Fee" prefix="€" type="number" - value={fees.registerOfDeedsFee.toString()} + value={fees.registerOfDeedsFee?.toString()} onChange={(_, newValue) => setFees({ ...fees, @@ -123,7 +123,7 @@ export const FeesPanel: React.FC = (props: FeesPanelProps) => { label="Land Registry Fee" prefix="€" type="number" - value={fees.landRegistryFee.toString()} + value={fees.landRegistryFee?.toString()} onChange={(_, newValue) => setFees({ ...fees,