i forgot whatever i've been doing, i think i added an inbox

This commit is contained in:
Xyphyn committed 2023-07-04 18:45:15 -07:00
1 parent ef037349f0
commit 04704749b7
24 files changed
+307 -86

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { DEFAULT_INSTANCE_URL, authData } from '$lib/lemmy.js'
import { error, redirect } from '@sveltejs/kit'
import { get } from 'svelte/store'
export function load({ params, url }) {
if (Number(params.instance)) {
const split = url.pathname.split('/')
split.splice(2, 0, `${get(authData)?.instance ?? DEFAULT_INSTANCE_URL}`)
const newUrl = new URL(url)
newUrl.pathname = split.join('/')
throw redirect(300, newUrl.toString())
}
throw error(404, 'Not found')
}