From 18749f0f74d803d6504f0083214da38597b6a6fe Mon Sep 17 00:00:00 2001 From: Nishit Suwal <81785002+NSUWAL123@users.noreply.github.com> Date: Thu, 29 Feb 2024 17:57:59 +0545 Subject: [PATCH] fix (frontend): uploadArea apply limit condition for only Km.sq. (#1304) --- .../src/components/createnewproject/UploadArea.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/createnewproject/UploadArea.tsx b/src/frontend/src/components/createnewproject/UploadArea.tsx index 788059cfdc..763ea84975 100644 --- a/src/frontend/src/components/createnewproject/UploadArea.tsx +++ b/src/frontend/src/components/createnewproject/UploadArea.tsx @@ -46,7 +46,8 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl const submission = () => { if (totalAreaSelection) { const totalArea = parseFloat(totalAreaSelection?.split(' ')[0]); - if (totalArea > 1000) { + const areaUnit = totalAreaSelection?.split(' ')[1]; + if (totalArea > 1000 && areaUnit === 'km²') { dispatch( CommonActions.SetSnackBar({ open: true, @@ -162,7 +163,8 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl useEffect(() => { if (totalAreaSelection) { const totalArea = parseFloat(totalAreaSelection?.split(' ')[0]); - if (totalArea > 100) { + const areaUnit = totalAreaSelection?.split(' ')[1]; + if (totalArea > 100 && areaUnit === 'km²') { dispatch( CommonActions.SetSnackBar({ open: true, @@ -172,7 +174,7 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl }), ); } - if (totalArea > 1000) { + if (totalArea > 1000 && areaUnit === 'km²') { dispatch( CommonActions.SetSnackBar({ open: true,