From ce4622b9543d14b304bf10bcc2d542ee248a14bc Mon Sep 17 00:00:00 2001 From: kunish Date: Mon, 9 Oct 2023 20:12:41 +0800 Subject: [PATCH] fix(setup): setup with url search string not working properly --- src/App.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index cd70a2a..9668ff6 100644 --- a/src/App.tsx +++ b/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 (