mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-05-12 10:00:40 +00:00
13 lines
481 B
TypeScript
13 lines
481 B
TypeScript
import { error, redirect } from '@sveltejs/kit'
|
|
|
|
import { dev } from '$app/environment'
|
|
import { SETUP_VERSION } from '$lib'
|
|
import native from '$lib/modules/native'
|
|
import { outdatedComponent } from '$lib/modules/update'
|
|
|
|
export async function load () {
|
|
if (!dev && !native.isApp) return error(401, 'How did you get here?')
|
|
if (Number(localStorage.getItem('setup-finished')) < SETUP_VERSION) redirect(307, '/setup')
|
|
|
|
if (await outdatedComponent) redirect(307, '/update/')
|
|
}
|