mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
fix(setup): setup with url search string not working properly
This commit is contained in:
parent
3fdd17f05a
commit
ce4622b954
15
src/App.tsx
15
src/App.tsx
@ -1,6 +1,6 @@
|
|||||||
import { usePrefersDark } from '@solid-primitives/media'
|
import { usePrefersDark } from '@solid-primitives/media'
|
||||||
import { Navigate, Route, Routes, useNavigate } from '@solidjs/router'
|
import { Navigate, Route, Routes } from '@solidjs/router'
|
||||||
import { Show, createEffect, lazy, onMount } from 'solid-js'
|
import { Show, createEffect, lazy } from 'solid-js'
|
||||||
import { Toaster } from 'solid-toast'
|
import { Toaster } from 'solid-toast'
|
||||||
import { twMerge } from 'tailwind-merge'
|
import { twMerge } from 'tailwind-merge'
|
||||||
import { Header } from '~/components'
|
import { Header } from '~/components'
|
||||||
@ -36,20 +36,11 @@ const ProtectedResources = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const App = () => {
|
export const App = () => {
|
||||||
const navigate = useNavigate()
|
|
||||||
|
|
||||||
const prefersDark = usePrefersDark()
|
const prefersDark = usePrefersDark()
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
if (autoSwitchTheme()) {
|
if (autoSwitchTheme())
|
||||||
setCurTheme(prefersDark() ? favNightTheme() : favDayTheme())
|
setCurTheme(prefersDark() ? favNightTheme() : favDayTheme())
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
if (!endpoint()) {
|
|
||||||
navigate(ROUTES.Setup)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user