fix runtime map loading lifecycle

This commit is contained in:
Tom Boullay
2026-04-28 14:42:49 +02:00
parent e01d6f27ba
commit 19bad2c8be
7 changed files with 65 additions and 44 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import type { MapNode, SceneData } from "@/types/editor";
import type { SceneData } from "@/types/editor";
import { parseMapNodes } from "@/utils/mapNodeValidation";
const MAP_JSON_PATH = "/map.json";
@@ -16,7 +17,7 @@ export async function createSceneDataFromFiles(
throw new Error("Fichier map.json manquant à la racine du dossier");
}
const mapNodes: MapNode[] = JSON.parse(await mapFile.text());
const mapNodes = parseMapNodes(JSON.parse(await mapFile.text()));
const models = new Map<string, string>();
for (const [path, file] of fileMap.entries()) {