Skip to content
This repository was archived by the owner on Jan 9, 2025. It is now read-only.

Commit 93310a5

Browse files
committed
Minor change
1 parent 072f851 commit 93310a5

File tree

1 file changed

+4
-4
lines changed
  • app/src/main/kotlin/com/mukeshsolanki/snake/presentation/component

1 file changed

+4
-4
lines changed

app/src/main/kotlin/com/mukeshsolanki/snake/presentation/component/Controller.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,28 @@ fun Controller(onDirectionChange: (Int) -> Unit) {
2525
) {
2626
AppIconButton(icon = Icons.Default.KeyboardArrowUp) {
2727
if (currentDirection.value != SnakeDirection.Down) {
28-
onDirectionChange(SnakeDirection.Up)
28+
onDirectionChange.invoke(SnakeDirection.Up)
2929
currentDirection.value = SnakeDirection.Up
3030
}
3131
}
3232
Row {
3333
AppIconButton(icon = Icons.Default.KeyboardArrowLeft) {
3434
if (currentDirection.value != SnakeDirection.Right) {
35-
onDirectionChange(SnakeDirection.Left)
35+
onDirectionChange.invoke(SnakeDirection.Left)
3636
currentDirection.value = SnakeDirection.Left
3737
}
3838
}
3939
Spacer(modifier = buttonSize)
4040
AppIconButton(icon = Icons.Default.KeyboardArrowRight) {
4141
if (currentDirection.value != SnakeDirection.Left) {
42-
onDirectionChange(SnakeDirection.Right)
42+
onDirectionChange.invoke(SnakeDirection.Right)
4343
currentDirection.value = SnakeDirection.Right
4444
}
4545
}
4646
}
4747
AppIconButton(icon = Icons.Default.KeyboardArrowDown) {
4848
if (currentDirection.value != SnakeDirection.Up) {
49-
onDirectionChange(SnakeDirection.Down)
49+
onDirectionChange.invoke(SnakeDirection.Down)
5050
currentDirection.value = SnakeDirection.Down
5151
}
5252
}

0 commit comments

Comments
 (0)