Fix
All checks were successful
Lint / lint (push) Successful in 11s

This commit is contained in:
Julien Valverdé
2025-07-06 19:18:28 +02:00
parent cc67e2d93f
commit edb391c1c0

View File

@@ -76,10 +76,10 @@ export const Todo = Component.make(function* Todo(props: TodoProps) {
</IconButton>
<IconButton
disabled={props.index >= todosSize}
disabled={props.index >= todosSize - 1}
onClick={() => Runtime.runSync(runtime)(
Ref.updateSome(state.ref, todos => Option.gen(function*() {
if (props.index >= Chunk.size(todos))
if (props.index >= Chunk.size(todos) - 1)
return yield* Option.none()
const toSwapIndex = props.index + 1