From a64ca62d1bdeae52a864a0981ea0553ba8b65fd5 Mon Sep 17 00:00:00 2001 From: RobolabGs2 Date: Fri, 2 Feb 2024 01:07:13 +0300 Subject: [PATCH] Fix build with not found window --- src/lib/App.svelte | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/App.svelte b/src/lib/App.svelte index 8cc385f..024b1c3 100644 --- a/src/lib/App.svelte +++ b/src/lib/App.svelte @@ -112,7 +112,12 @@ } catch (e: unknown) { $error = e; } - + window.addEventListener('keydown', (ev) => { + if (ev.key == 'F12') { + if (ev.ctrlKey) devMode = !devMode; + else if (ev.shiftKey) devTools = true; + } + }); return () => memaker.clear(); }); @@ -128,12 +133,6 @@ let devMode = false; let devTools = false; - window.addEventListener('keydown', (ev) => { - if (ev.key == 'F12') { - if (ev.ctrlKey) devMode = !devMode; - else if (ev.shiftKey) devTools = true; - } - });