Skip to content

Commit dc3841e

Browse files
committed
fix index bug
1 parent 760c134 commit dc3841e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/lib/redis.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ export const tedashi = async (
7373
if (index < 0 || 12 < index) {
7474
throw new Error("index out of tehai length");
7575
}
76-
const deletedTehai = state.tehai.filter((_, i) => i !== index);
77-
const discardedHai = state.tehai[index];
76+
const sortedTehai = sortTehai(state.tehai);
77+
const deletedTehai = sortedTehai.filter((_, i) => i !== index);
78+
const discardedHai = sortedTehai[index];
7879

7980
const newGameState: GameState = {
8081
...state,

0 commit comments

Comments
 (0)