From ec92000f2db773d42880d09d0f6e60180b2cdc85 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 8 Mar 2024 21:35:47 +0700 Subject: [PATCH] fixed --- src/routes/$namespace/index.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/routes/$namespace/index.tsx b/src/routes/$namespace/index.tsx index 71f2e03..2b398bc 100644 --- a/src/routes/$namespace/index.tsx +++ b/src/routes/$namespace/index.tsx @@ -3,8 +3,18 @@ import { requireChains } from "@/entities/chain/lib"; import { useChainState } from "@/entities/chain/model"; import { createFileRoute } from "@tanstack/react-router"; +import { Typography } from "@mui/material"; + function IndexPage() { - return
content
; + return ( + + Создайте цепочку + + ); } export const Route = createFileRoute("/$namespace/")({ @@ -13,13 +23,12 @@ export const Route = createFileRoute("/$namespace/")({ await requireChains(); const chains = useChainState.getState().chains; - if (typeof chains === "undefined" || !chains[0]._id) - throw redirect({ to: "/" }); + if (typeof chains === "undefined") throw redirect({ to: "/" }); - if (chains.length > 0) + if (chains[0]?._id) throw redirect({ to: "/$namespace/$chainId", - params: { namespace: params.namespace, chainId: chains[0]._id }, + params: { namespace: params.namespace, chainId: chains[0]!._id }, }); }, });