fix
This commit is contained in:
parent
ee9746053e
commit
60ba131b81
|
|
@ -2,12 +2,12 @@ import { useChainState } from "./model";
|
|||
import { getChainList } from "./api/list";
|
||||
import { redirect } from "@tanstack/react-router";
|
||||
|
||||
export async function requireChains() {
|
||||
export async function requireChains(namespaceId: string) {
|
||||
const chainState = useChainState.getState();
|
||||
if (chainState.chains) return;
|
||||
|
||||
const chains = await getChainList();
|
||||
if (chains === null) throw redirect({ to: "/" });
|
||||
const chains = await getChainList(namespaceId);
|
||||
if (chains === null || chains.length === 0) throw redirect({ to: "/" });
|
||||
|
||||
chainState.setChains(chains);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user