From f0425afb56ec91738ab6472d21811a38363fd320 Mon Sep 17 00:00:00 2001 From: Vibhu Tomer Date: Wed, 13 May 2026 06:12:55 +0000 Subject: [PATCH] fix(newfile): await local storage promise to prevent data corruption --- Govt-Billing-React/src/components/NewFile/NewFile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Govt-Billing-React/src/components/NewFile/NewFile.tsx b/Govt-Billing-React/src/components/NewFile/NewFile.tsx index f1adffa..beaeb15 100644 --- a/Govt-Billing-React/src/components/NewFile/NewFile.tsx +++ b/Govt-Billing-React/src/components/NewFile/NewFile.tsx @@ -12,10 +12,10 @@ const NewFile: React.FC<{ billType: number; }> = (props) => { const [showAlertNewFileCreated, setShowAlertNewFileCreated] = useState(false); - const newFile = () => { + const newFile = async () => { if (props.file !== "default") { const content = encodeURIComponent(AppGeneral.getSpreadsheetContent()); - const data = props.store._getFile(props.file); + const data = await props.store._getFile(props.file); const file = new File( (data as any).created, new Date().toString(),