feat: fix debugger protection trigger on dev builds

This commit is contained in:
Flavio Fois
2026-02-05 12:39:28 +01:00
parent 3fb2f95e8a
commit 671f5aa8aa

View File

@@ -31,10 +31,12 @@
} from "$lib/wailsjs/runtime/runtime"; } from "$lib/wailsjs/runtime/runtime";
import { RefreshCcwDot } from "@lucide/svelte"; import { RefreshCcwDot } from "@lucide/svelte";
import { IsDebuggerRunning, QuitApp } from "$lib/wailsjs/go/main/App"; import { IsDebuggerRunning, QuitApp } from "$lib/wailsjs/go/main/App";
import { settingsStore } from "$lib/stores/settings.svelte.js";
let versionInfo: utils.Config | null = $state(null); let versionInfo: utils.Config | null = $state(null);
let isMaximized = $state(false); let isMaximized = $state(false);
let isDebugerOn: boolean = $state(false); let isDebugerOn: boolean = $state(false);
let isDebbugerProtectionOn: boolean = $state(true);
async function syncMaxState() { async function syncMaxState() {
isMaximized = await WindowIsMaximised(); isMaximized = await WindowIsMaximised();
@@ -69,7 +71,7 @@
} }
onMount(async () => { onMount(async () => {
if (browser) { if (browser && isDebbugerProtectionOn) {
detectDebugging(); detectDebugging();
setInterval(detectDebugging, 1000); setInterval(detectDebugging, 1000);
} }
@@ -118,6 +120,8 @@
} catch { } catch {
stored = null; stored = null;
} }
isDebbugerProtectionOn = settingsStore.settings.enableAttachedDebuggerProtection ? true : false;
$inspect(isDebbugerProtectionOn, "isDebbugerProtectionOn");
applyTheme(stored === "light" ? "light" : "dark"); applyTheme(stored === "light" ? "light" : "dark");
}); });