mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 05:15: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 { Navigate, Route, Routes, useNavigate } from '@solidjs/router'
|
||||
import { Show, createEffect, lazy, onMount } from 'solid-js'
|
||||
import { Navigate, Route, Routes } from '@solidjs/router'
|
||||
import { Show, createEffect, lazy } from 'solid-js'
|
||||
import { Toaster } from 'solid-toast'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
import { Header } from '~/components'
|
||||
@ -36,20 +36,11 @@ const ProtectedResources = () => {
|
||||
}
|
||||
|
||||
export const App = () => {
|
||||
const navigate = useNavigate()
|
||||
|
||||
const prefersDark = usePrefersDark()
|
||||
|
||||
createEffect(() => {
|
||||
if (autoSwitchTheme()) {
|
||||
if (autoSwitchTheme())
|
||||
setCurTheme(prefersDark() ? favNightTheme() : favDayTheme())
|
||||
}
|
||||
})
|
||||
|
||||
onMount(() => {
|
||||
if (!endpoint()) {
|
||||
navigate(ROUTES.Setup)
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user