mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
fix(ui): packResult not changed when regenerate
This commit is contained in:
Binary file not shown.
+2
-2
@@ -38,7 +38,7 @@
|
||||
"@radix-ui/react-tabs": "^1.1.3",
|
||||
"@radix-ui/react-tooltip": "^1.1.8",
|
||||
"@tailwindcss/vite": "^4.0.7",
|
||||
"@tanstack/react-query": "^5.66.7",
|
||||
"@tanstack/react-query": "^5.66.8",
|
||||
"@tanstack/react-router": "^1.106.0",
|
||||
"@tanstack/router-devtools": "^1.106.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
@@ -51,7 +51,7 @@
|
||||
"react-hook-form": "^7.54.2",
|
||||
"react-i18next": "^15.4.1",
|
||||
"react-syntax-highlighter": "^15.6.1",
|
||||
"sonner": "^2.0.0",
|
||||
"sonner": "^2.0.1",
|
||||
"tailwind-merge": "^3.0.1",
|
||||
"tailwind-scrollbar": "^4.0.0",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
} from "@/types/shell.ts";
|
||||
import { TFunction } from "i18next";
|
||||
import { CircleHelpIcon, FileTextIcon, ScrollTextIcon, TriangleAlertIcon } from "lucide-react";
|
||||
import { Fragment, useState } from "react";
|
||||
import { Fragment, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
|
||||
@@ -280,6 +280,14 @@ function MultiPackResult({
|
||||
const packMethods = Object.keys(allPackResults ?? {});
|
||||
const [selectedMethod, setSelectedMethod] = useState(packMethods[0]);
|
||||
const [packResult, setPackResult] = useState(allPackResults?.[selectedMethod as keyof typeof allPackResults] ?? "");
|
||||
|
||||
useEffect(() => {
|
||||
const methods = Object.keys(allPackResults ?? {});
|
||||
const firstMethod = methods[0];
|
||||
setSelectedMethod(firstMethod);
|
||||
setPackResult(allPackResults?.[firstMethod as keyof typeof allPackResults] ?? "");
|
||||
}, [allPackResults]);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<CodeViewer
|
||||
|
||||
Reference in New Issue
Block a user