Skip to content

Commit e21a205

Browse files
committed
fix(commandline): running wrong command on mobile or when not moving the mouse
closes monkeytypegame#6037
1 parent 527d657 commit e21a205

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frontend/src/ts/commandline/commandline.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,11 @@ async function showCommands(): Promise<void> {
430430
await updateActiveCommand();
431431
});
432432
command.addEventListener("click", async () => {
433+
const previous = activeIndex;
433434
activeIndex = parseInt(command.getAttribute("data-index") ?? "0");
435+
if (previous !== activeIndex) {
436+
await updateActiveCommand();
437+
}
434438
await runActiveCommand();
435439
});
436440
}

0 commit comments

Comments
 (0)