Skip to content

Commit

Permalink
Merge pull request #33 from sanity-io/fix-ordering
Browse files Browse the repository at this point in the history
fix: new order for empty state lists
  • Loading branch information
SimeonGriggs committed Jun 13, 2023
2 parents 2902dca + 529128e commit 5b12208
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/WorkflowTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ export default function WorkflowTool(props: WorkflowToolProps) {
// Only the first state should generate an absolute minimum rank
newOrder = LexoRank.min().toString()
} else {
// Otherwise create the next rank between min and the globally minimum rank
newOrder = LexoRank.parse(globalStateMinimumRank)
.between(LexoRank.min())
.toString()
// Otherwise create one rank above the minimum
newOrder = LexoRank.min().genNext().toString()
}
} else if (destination.index === 0) {
// Now first item in order
Expand Down

0 comments on commit 5b12208

Please sign in to comment.