mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-05 23:29:45 +00:00
fix: load loop
This commit is contained in:
parent
904e5912b0
commit
cf49796b0b
3 changed files with 13 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ui",
|
||||
"version": "6.0.2",
|
||||
"version": "6.0.3",
|
||||
"license": "BUSL-1.1",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.14.4",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
import { redirect, error } from '@sveltejs/kit'
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
|
||||
import { outdatedComponent } from '$lib/modules/update'
|
||||
import { SETUP_VERSION } from '$lib'
|
||||
import { dev } from '$app/environment'
|
||||
import native from '$lib/modules/native'
|
||||
|
||||
export async function load () {
|
||||
if (!dev && !native.isApp) return error(401, 'How did you get here?')
|
||||
if (await outdatedComponent) return redirect(307, '/update/')
|
||||
redirect(307, Number(localStorage.getItem('setup-finished')) >= SETUP_VERSION ? '/app/home/' : '/setup')
|
||||
}
|
||||
|
|
|
|||
11
src/routes/setup/+layout.ts
Normal file
11
src/routes/setup/+layout.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { error, redirect } from '@sveltejs/kit'
|
||||
|
||||
import { dev } from '$app/environment'
|
||||
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 (await outdatedComponent) redirect(307, '/update/')
|
||||
}
|
||||
Loading…
Reference in a new issue