Add context clearing on resource deletion and tag editing

This commit is contained in:
2025-06-08 14:07:28 +08:00
parent 3c3f9e9d35
commit b0680fa94f
2 changed files with 11 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ import { Turnstile } from "@marsidev/react-turnstile";
import Button from "../components/button.tsx";
import Badge, { BadgeAccent } from "../components/badge.tsx";
import Input from "../components/input.tsx";
import { useAppContext } from "../components/AppContext.tsx";
export default function ResourcePage() {
const params = useParams();
@@ -257,6 +258,8 @@ function DeleteResourceDialog({
const { t } = useTranslation();
const context = useAppContext();
const handleDelete = async () => {
if (isLoading) {
return;
@@ -272,6 +275,7 @@ function DeleteResourceDialog({
message: t("Resource deleted successfully"),
type: "success",
});
context.clear();
navigate("/", { replace: true });
} else {
showToast({ message: res.message, type: "error" });