mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-20 08:52:59 +00:00
feat: backup import (except chords) feat: legacy layout import feat: separate layout, chord & setting backup downloads
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 = new URLSearchParams(url.search).get("import")
|
|
return {
|
|
...data,
|
|
importFile: browser && importFile ? await charaFileFromUriComponent(importFile, fetch) : undefined,
|
|
}
|
|
}) satisfies LayoutLoad
|