Skip to content

Commit

Permalink
fix (frontend): uploadArea apply limit condition for only Km.sq. (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
NSUWAL123 authored Feb 29, 2024
1 parent 3beca5e commit 18749f0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/frontend/src/components/createnewproject/UploadArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -172,7 +174,7 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl
}),
);
}
if (totalArea > 1000) {
if (totalArea > 1000 && areaUnit === 'km²') {
dispatch(
CommonActions.SetSnackBar({
open: true,
Expand Down

0 comments on commit 18749f0

Please sign in to comment.