From 7812c8ccad40495eab7dce0fb685ec5c13e5d397 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 8 Mar 2024 05:34:54 +0700 Subject: [PATCH] ts fixes --- src/routes/$namespace/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/$namespace/index.tsx b/src/routes/$namespace/index.tsx index c0756f5..71f2e03 100644 --- a/src/routes/$namespace/index.tsx +++ b/src/routes/$namespace/index.tsx @@ -13,11 +13,12 @@ export const Route = createFileRoute("/$namespace/")({ await requireChains(); const chains = useChainState.getState().chains; - if (typeof chains === "undefined") throw redirect({ to: "/" }); + if (typeof chains === "undefined" || !chains[0]._id) + throw redirect({ to: "/" }); if (chains.length > 0) throw redirect({ - to: `/$namespace/$chainId`, + to: "/$namespace/$chainId", params: { namespace: params.namespace, chainId: chains[0]._id }, }); },