Skip to content

Commit df1d6cf

Browse files
fix(overmind-devtools): correctly sort operators
1 parent 7cb837b commit df1d6cf

File tree

1 file changed

+2
-4
lines changed
  • packages/node_modules/overmind-devtools/src/components/Action

1 file changed

+2
-4
lines changed

packages/node_modules/overmind-devtools/src/components/Action/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ type OperatorsByPath = {
1515
// TODO: Remove flush by action id?
1616
const Action: FunctionComponent = () => {
1717
const { state } = useOvermind()
18-
1918
const operators = Object.keys(state.currentAction.operators)
20-
.sort()
19+
.map((id) => Number(id))
20+
.sort((a, b) => a - b)
2121
.map((operatorId) => state.currentAction.operators[operatorId])
2222
const operatorsByPath = operators.reduce(
2323
(aggr, operator): OperatorsByPath[] => {
@@ -47,7 +47,6 @@ const Action: FunctionComponent = () => {
4747
} else {
4848
currentValue = child.value
4949
}
50-
5150
return child.children
5251
}, aggr)
5352

@@ -104,7 +103,6 @@ const Action: FunctionComponent = () => {
104103
}
105104

106105
console.log(operatorsByPath)
107-
108106
return (
109107
<div className={styles.wrapper}>
110108
{renderOperators(operatorsByPath)}

0 commit comments

Comments
 (0)