Skip to content

Commit

Permalink
fix: rename NaN check function.
Browse files Browse the repository at this point in the history
  • Loading branch information
mheggelund committed Dec 13, 2023
1 parent 7937f61 commit fcdc05a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/AreaCoordinates/AreaCoordinates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const AreaCoordinates = ({ modelId }: { modelId: string }) => {
setSaveAlert(false);
}

function isNumber(value: any) {
function NotANumber(value: any) {
return isNaN(value);
}

Expand Down Expand Up @@ -242,16 +242,16 @@ export const AreaCoordinates = ({ modelId }: { modelId: string }) => {
if (area && area.coordinates[0].y === area.coordinates[1].y) {
errors.y0 = 'Y coodridnates can´t be equal.';
}
if (area && isNumber(area.coordinates[0].x)) {
if (area && NotANumber(area.coordinates[0].x)) {
errors.x0 = 'Coodridnates can´t be string, just numbers is alowed.';
}
if (area && isNumber(area.coordinates[0].y)) {
if (area && NotANumber(area.coordinates[0].y)) {
errors.y0 = 'Coodridnates can´t be string, just numbers is alowed.';
}
if (area && isNumber(area.coordinates[1].x)) {
if (area && NotANumber(area.coordinates[1].x)) {
errors.x1 = 'Coodridnates can´t be string, just numbers is alowed.';
}
if (area && isNumber(area.coordinates[1].y)) {
if (area && NotANumber(area.coordinates[1].y)) {
errors.y1 = 'Coodridnates can´t be string, just numbers is alowed.';
}
if (area && (area.coordinates[1].x === 0 || area.coordinates[1].y === 0)) {
Expand Down

0 comments on commit fcdc05a

Please sign in to comment.