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',
|
title: 'Discord',
|
||||||
url: '#',
|
url: 'https://discord.gg/72vuHcwUkE',
|
||||||
icon: CircleHelp
|
icon: CircleHelp
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -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 }));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@ export const load: PageServerLoad = async ({ url, locals, fetch }) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
title: 'Chapitres',
|
||||||
|
|
||||||
chapters,
|
chapters,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -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)),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue