miru/src/routes/app/w2g/+page.ts
ThaUnknown d8c2a25a34
fix: w2g initial sync state, chat bug on message send
feat: message toasts for w2g
2025-06-15 20:47:54 +02:00

13 lines
535 B
TypeScript

import { redirect } from '@sveltejs/kit'
import { get } from 'svelte/store'
import { server } from '$lib/modules/torrent'
import { generateRandomHexCode, W2GClient } from '$lib/modules/w2g'
import { w2globby } from '$lib/modules/w2g/lobby'
export function load () {
const lastVal = get(server.last)
w2globby.value ??= new W2GClient(generateRandomHexCode(16), true, lastVal?.media.id ? { mediaId: lastVal.media.id, episode: lastVal.episode, torrent: lastVal.id } : undefined)
redirect(302, '/app/w2g/' + w2globby.value.code)
}