Updates and more

This commit is contained in:
2023-11-12 22:43:42 +01:00
parent 7450ecdabb
commit 3889f28eb8
43 changed files with 5188 additions and 322 deletions

View File

@@ -1,9 +1,9 @@
import type {Player, SchematicType, Server} from "../types/data.js";
import {PlayerSchema, ServerSchema} from "../types/data.js";
import type {Player, SchematicType} from "../types/data.js";
import {PlayerSchema} from "../types/data.js";
import {cached, cachedFamily} from "./cached.js";
import type {Team} from "../types/team.js";
import {TeamSchema} from "../types/team.js";
import {derived, get, readable, writable} from "svelte/store";
import {derived, get, writable} from "svelte/store";
import {dataRepo, fetchWithToken, pageRepo, tokenStore} from "../repo/repo.js";
import {z} from "zod";
@@ -47,7 +47,7 @@ export const branches = cached<string[]>([], async () => {
return z.array(z.string()).parse(res);
})
export const server = readable(new Promise((resolve) => {}), (set) => set(get(dataRepo).getServer()));
export const server = derived(dataRepo, $dataRepo => $dataRepo.getServer());
export const isWide = writable(window.innerWidth >= 640);
window.addEventListener("resize", () => isWide.set(window.innerWidth >= 640));