fix(3d-nds): lag modal was stealing the keys

This commit is contained in:
2026-02-26 12:05:13 +01:00
parent fefd1e171a
commit 1827659d3d
3 changed files with 8 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ export const useKeyDown = (callback: KeyDownCallback) => {
const app = useAppStore();
const handleKeyDown = (event: KeyboardEvent) => {
if (app.lagDetected) return;
if (app.lagModalOpen) return;
const ndsButton = mapCodeToNDS(event.code);
if (ndsButton && document.activeElement && document.activeElement !== document.body) {

View File

@@ -12,8 +12,12 @@ const lagModal = overlay.create(LazyLagModal);
watch(
() => app.lagDetected,
(detected) => {
if (detected) lagModal.open();
async (detected) => {
if (detected) {
app.lagModalOpen = true;
await lagModal.open();
app.lagModalOpen = false;
}
},
);

View File

@@ -57,6 +57,7 @@ export const useAppStore = defineStore("app", {
hintsVisible: false,
hintsAllowed: false,
lagDetected: false,
lagModalOpen: false,
};
},