Skip to content

Commit

Permalink
fix: Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mheggelund committed Dec 13, 2023
1 parent 7817b70 commit 7937f61
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/AreaCoordinates/AreaCoordinates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,21 @@ export const AreaCoordinates = ({ modelId }: { modelId: string }) => {
// Populate state with existing data
else if (selectedArea && selectedArea?.length > 0) {
setNewArea(undefined);

const m0 = selectedArea[0].coordinates.filter((c) => c.m === 0);
const m1 = selectedArea[0].coordinates.filter((c) => c.m === 1);

const newState: AreaCoordinateType = {
modelAreaId: selectedArea[0].modelAreaId,
coordinates: [
{
x: selectedArea[0].coordinates[0].x,
y: selectedArea[0].coordinates[0].y,
x: m0[0].x,
y: m0[0].y,
m: 0,
},
{
x: selectedArea[0].coordinates[1].x,
y: selectedArea[0].coordinates[1].y,
x: m1[0].x,
y: m1[0].y,
m: 1,
},
],
Expand All @@ -229,7 +233,7 @@ export const AreaCoordinates = ({ modelId }: { modelId: string }) => {
const validateCoordinates = (area: AreaCoordinateType | undefined) => {
const errors: ErrorType = {};
if (!activeArea || activeArea.modelAreaTypeId === '') {
errors.area = 'Moedl area needs to be selected';
errors.area = 'Model area needs to be selected';
}

if (area && area.coordinates[0].x === area.coordinates[1].x) {
Expand Down

0 comments on commit 7937f61

Please sign in to comment.