fix: Discord & titles

This commit is contained in:
glazk0 2025-01-28 21:45:42 +01:00
parent 2442b83bf3
commit ca0e0181e5
No known key found for this signature in database
5 changed files with 8 additions and 4 deletions

View file

@ -42,7 +42,7 @@
}, },
{ {
title: 'Discord', title: 'Discord',
url: '#', url: 'https://discord.gg/72vuHcwUkE',
icon: CircleHelp icon: CircleHelp
} }
] ]

View file

@ -1,11 +1,11 @@
import type { StateStore } from "./state"; import type { StateStore } from "./state";
export const connectWebSocket = <T>(path: string, store: StateStore<T>, token: string | undefined = undefined) => { export const connectWebSocket = <T>(path: string, store: StateStore<T>, token: object = {}) => {
const ws = new WebSocket(`wss://api.peerat.dev${path}`); const ws = new WebSocket(`wss://api.peerat.dev${path}`);
ws.onopen = () => { ws.onopen = () => {
if (token) { if (token) {
ws.send(JSON.stringify({ token })); ws.send(JSON.stringify({ ...token }));
} }
}; };

View file

@ -24,7 +24,7 @@
const stateStore = createStateStore<Log>(); const stateStore = createStateStore<Log>();
onMount(() => { onMount(() => {
connectWebSocket('/admin/logs', stateStore, data.session); connectWebSocket('/admin/logs', stateStore, { token: data.session });
return () => stateStore.reset(); return () => stateStore.reset();
}); });

View file

@ -29,6 +29,8 @@ export const load: PageServerLoad = async ({ url, locals, fetch }) => {
}); });
return { return {
title: 'Chapitres',
chapters, chapters,
}; };
}; };

View file

@ -18,6 +18,8 @@ export const load: PageServerLoad = async ({ locals }) => {
} }
return { return {
title: 'Inscription',
form: await superValidate(zod(formSchema)), form: await superValidate(zod(formSchema)),
formConfirmation: await superValidate(zod(formConfirmationSchema)), formConfirmation: await superValidate(zod(formConfirmationSchema)),
} }