fixed reload
This commit is contained in:
parent
55e22e130e
commit
108e160a63
|
|
@ -3,6 +3,7 @@ import type { Chain } from "@/entities/chain/schema";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { upsertChain } from "@/entities/chain/api/upsert";
|
import { upsertChain } from "@/entities/chain/api/upsert";
|
||||||
import { useChainState } from "@/entities/chain/model";
|
import { useChainState } from "@/entities/chain/model";
|
||||||
|
import { useNavigate } from "@tanstack/react-router";
|
||||||
|
|
||||||
import Dialog from "@mui/material/Dialog";
|
import Dialog from "@mui/material/Dialog";
|
||||||
import DialogActions from "@mui/material/DialogActions";
|
import DialogActions from "@mui/material/DialogActions";
|
||||||
|
|
@ -20,6 +21,7 @@ export default function RenameChainButton({ chain }: RenameChainButtonProps) {
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [isError, setIsError] = useState(false);
|
const [isError, setIsError] = useState(false);
|
||||||
|
const navigate = useNavigate({ from: "/$namespace/$chainId" });
|
||||||
|
|
||||||
const [chainName, setChainName] = useState(chain.name || "");
|
const [chainName, setChainName] = useState(chain.name || "");
|
||||||
const updateChain = useChainState((state) => state.updateChain);
|
const updateChain = useChainState((state) => state.updateChain);
|
||||||
|
|
@ -42,6 +44,7 @@ export default function RenameChainButton({ chain }: RenameChainButtonProps) {
|
||||||
|
|
||||||
if (upsertedChain) {
|
if (upsertedChain) {
|
||||||
updateChain(upsertedChain);
|
updateChain(upsertedChain);
|
||||||
|
navigate({ to: "/$namespace/$chainId" });
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user