mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-19 08:22:53 +00:00
15 lines
491 B
TypeScript
15 lines
491 B
TypeScript
import type {LayoutLoad} from "./$types"
|
|
import {browser} from "$app/environment"
|
|
import {charaFileFromUriComponent} from "$lib/share/share-url"
|
|
|
|
export const prerender = true
|
|
export const trailingSlash = "always"
|
|
|
|
export const load = (async ({url, data, fetch}) => {
|
|
const importFile = browser && new URLSearchParams(url.search).get("import")
|
|
return {
|
|
...data,
|
|
importFile: importFile ? await charaFileFromUriComponent(importFile, fetch) : undefined,
|
|
}
|
|
}) satisfies LayoutLoad
|