Release 2.0.0
Updated display and host
This commit is contained in:
@@ -6,27 +6,11 @@
|
||||
import ws from "$lib/websocket.svelte";
|
||||
import { MessageType } from "$lib/MessageType";
|
||||
import type { VisitedQuestions } from "$lib/Types";
|
||||
import { onMount } from "svelte";
|
||||
import { fetchWall } from "../../../../../editor/fetchers";
|
||||
|
||||
console.log("wall:", page.params.wall);
|
||||
|
||||
let paramWall = page.params.wall;
|
||||
if (paramWall === undefined) {
|
||||
error(404);
|
||||
}
|
||||
const wallIndex = parseInt(paramWall);
|
||||
if (isNaN(wallIndex)) {
|
||||
error(404);
|
||||
}
|
||||
if (DisplayStateSvelte.wallIndex !== wallIndex) {
|
||||
const wall = DisplayStateSvelte.game?.walls[wallIndex];
|
||||
if (wall) {
|
||||
DisplayStateSvelte.wall = wall;
|
||||
DisplayStateSvelte.gameIndex = wallIndex;
|
||||
} else {
|
||||
error(404);
|
||||
}
|
||||
}
|
||||
|
||||
let visited: VisitedQuestions = $state([]);
|
||||
|
||||
$effect(() => {
|
||||
@@ -40,6 +24,12 @@
|
||||
}
|
||||
} catch (e) {}
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
fetchWall(`${page.params.wall}`).then((wall) => {
|
||||
DisplayStateSvelte.wall = wall;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<Wall wall={DisplayStateSvelte.wall} {visited} />
|
||||
|
||||
Reference in New Issue
Block a user