fix: archi

This commit is contained in:
2026-04-27 10:53:50 +02:00
parent 8c84663472
commit 393b653cca
16 changed files with 242 additions and 192 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import GUI from "lil-gui";
import type { CameraMode, SceneMode } from "@/types/debug";
import { isDebugEnabled } from "@/utils/debug/isDebugEnabled";
export class Debug {
private static instance: Debug | null = null;
@@ -28,7 +29,7 @@ export class Debug {
}
private constructor() {
this.active = new URLSearchParams(window.location.search).has("debug");
this.active = isDebugEnabled();
this.gui = this.active ? new GUI({ title: "La-Fabrik Debug" }) : null;
if (this.gui) {
+7
View File
@@ -0,0 +1,7 @@
export function isDebugEnabled(): boolean {
if (typeof window === "undefined") {
return false;
}
return new URLSearchParams(window.location.search).has("debug");
}
+2 -3
View File
@@ -4,6 +4,7 @@ import type {
LogLevel,
LoggerConfig,
} from "@/types/logger";
import { isDebugEnabled } from "@/utils/debug/isDebugEnabled";
const LEVEL_PRIORITY: Record<LogLevel, number> = {
debug: 10,
@@ -102,9 +103,7 @@ function resolveMinLevel(): LogLevel {
return "info";
}
const debugEnabled = new URLSearchParams(window.location.search).has("debug");
return debugEnabled ? "debug" : "info";
return isDebugEnabled() ? "debug" : "info";
}
export const logger = new Logger({