Skip to content

Commit

Permalink
fix: ensure area is correctly displayed when navigating back to DrawB…
Browse files Browse the repository at this point in the history
…oundary (#4119)
  • Loading branch information
jessicamcinchak authored Jan 8, 2025
1 parent d794668 commit 5088b53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ export default function Component(props: Props) {
props.previouslySubmittedData?.data?.[props.fn] ||
passport.data?.["property.boundary"];
const previousArea =
props.previouslySubmittedData?.data?.[props.fn] ||
props.previouslySubmittedData?.data?.[`${props.fn}.area`] ||
passport.data?.["property.boundary.area"];

const [boundary, setBoundary] = useState<Boundary>(previousBoundary);
const [area, setArea] = useState<number | undefined>(previousArea);
const [mapValidationError, setMapValidationError] = useState<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const parseDrawBoundary = (
data?.descriptionForUploading ||
defaultContent?.["descriptionForUploading"],
hideFileUpload: data?.hideFileUpload || defaultContent?.["hideFileUpload"],
fn: data?.fn || defaultContent?.["fn"],
fn: defaultContent?.["fn"], // input is disabled, no need to account for data?.fn
info: data?.info || defaultContent?.["info"],
policyRef: data?.policyRef || defaultContent?.["policyRef"],
howMeasured: data?.howMeasured || defaultContent?.["howMeasured"],
Expand Down

0 comments on commit 5088b53

Please sign in to comment.