Skip to content

Commit

Permalink
Remove else if on position calculation (#5691)
Browse files Browse the repository at this point in the history
As title
  • Loading branch information
thomtrp authored May 31, 2024
1 parent fbd8714 commit 9fd761d
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ export const getDraggedRecordPosition = (
): number => {
if (isDefined(recordAfterPosition) && isDefined(recordBeforePosition)) {
return (recordBeforePosition + recordAfterPosition) / 2;
} else if (isDefined(recordAfterPosition)) {
}

if (isDefined(recordAfterPosition)) {
return recordAfterPosition - 1;
} else if (isDefined(recordBeforePosition)) {
}

if (isDefined(recordBeforePosition)) {
return recordBeforePosition + 1;
} else {
return 1;
}

return 1;
};

0 comments on commit 9fd761d

Please sign in to comment.