fix: Discord & titles
This commit is contained in:
parent
2442b83bf3
commit
ca0e0181e5
5 changed files with 8 additions and 4 deletions
|
@ -42,7 +42,7 @@
|
|||
},
|
||||
{
|
||||
title: 'Discord',
|
||||
url: '#',
|
||||
url: 'https://discord.gg/72vuHcwUkE',
|
||||
icon: CircleHelp
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
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}`);
|
||||
|
||||
ws.onopen = () => {
|
||||
if (token) {
|
||||
ws.send(JSON.stringify({ token }));
|
||||
ws.send(JSON.stringify({ ...token }));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
const stateStore = createStateStore<Log>();
|
||||
|
||||
onMount(() => {
|
||||
connectWebSocket('/admin/logs', stateStore, data.session);
|
||||
connectWebSocket('/admin/logs', stateStore, { token: data.session });
|
||||
return () => stateStore.reset();
|
||||
});
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ export const load: PageServerLoad = async ({ url, locals, fetch }) => {
|
|||
});
|
||||
|
||||
return {
|
||||
title: 'Chapitres',
|
||||
|
||||
chapters,
|
||||
};
|
||||
};
|
||||
|
|
|
@ -18,6 +18,8 @@ export const load: PageServerLoad = async ({ locals }) => {
|
|||
}
|
||||
|
||||
return {
|
||||
title: 'Inscription',
|
||||
|
||||
form: await superValidate(zod(formSchema)),
|
||||
formConfirmation: await superValidate(zod(formConfirmationSchema)),
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue