This commit is contained in:
Robert 2024-03-08 05:34:54 +07:00
parent 041eda05e5
commit 7812c8ccad
No known key found for this signature in database
GPG Key ID: F631C7FD957D5F22

View File

@ -13,11 +13,12 @@ export const Route = createFileRoute("/$namespace/")({
await requireChains(); await requireChains();
const chains = useChainState.getState().chains; 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) if (chains.length > 0)
throw redirect({ throw redirect({
to: `/$namespace/$chainId`, to: "/$namespace/$chainId",
params: { namespace: params.namespace, chainId: chains[0]._id }, params: { namespace: params.namespace, chainId: chains[0]._id },
}); });
}, },