From 401678c86e8997f33cd1af2a67f9e3ae2b008c7d Mon Sep 17 00:00:00 2001 From: typist Date: Tue, 28 Oct 2025 00:55:48 +0800 Subject: [PATCH] feat: update routing to redirect to tool paths - Modified router configuration to set default redirects for the root and wildcard paths to "/tool" and "/tool/uuid". - Simplified loader functions for cleaner code. --- src/router.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/router.tsx b/src/router.tsx index c750c18..c73043d 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -24,7 +24,7 @@ const router = createBrowserRouter([ )), { index: true, - element: null, + loader: () => redirect("/tool/uuid"), }, ] }, @@ -32,15 +32,11 @@ const router = createBrowserRouter([ }, { index: true, - loader: () => { - return redirect("/tool"); - }, + loader: () => redirect("/tool"), }, { path: "*", - loader: () => { - return redirect("/tool"); - }, + loader: () => redirect("/tool"), }, ]);