Skip to content

Commit

Permalink
fix: remove data extract on different dropdown selection
Browse files Browse the repository at this point in the history
  • Loading branch information
varun2948 committed Sep 11, 2023
1 parent cddc460 commit 3cba915
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/frontend/fmtm_openlayer_map/src/views/DefineAreaMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const DefineAreaMap = ({
setDataExtractedGeojson(e.target.result);
};
} else {
setDataExtractedGeojson(null);
}
}, [uploadedDataExtractFile]);
useEffect(() => {
Expand All @@ -63,6 +64,7 @@ const DefineAreaMap = ({
setLineExtractedGeojson(e.target.result);
};
} else {
setLineExtractedGeojson(null);
}
}, [uploadedLineExtractFile]);
return (
Expand Down Expand Up @@ -128,7 +130,7 @@ const DefineAreaMap = ({
constrainResolution: true,
duration: 2000,
}}
// zoomToLayer
zoomToLayer
/>
)}
{lineExtractedGeojson && (
Expand All @@ -151,7 +153,7 @@ const DefineAreaMap = ({
constrainResolution: true,
duration: 2000,
}}
// zoomToLayer
zoomToLayer
/>
)}
</MapComponent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ const DataExtract: React.FC<any> = ({
submission,
DataExtractValidation,
);
useEffect(() => {
if (values.data_extract_options === 'Data Extract Ways') {
setDataExtractFile(null);
setDataExtractFileValue(null);
setLineExtractFile(null);
setLineExtractFileValue(null);
}
}, [values.data_extract_options]);

return (
<CoreModules.Stack
Expand Down

0 comments on commit 3cba915

Please sign in to comment.