fix: refresh Pi credential readiness
This commit is contained in:
@@ -10,7 +10,6 @@ import {
|
||||
savePiManagementConfig,
|
||||
type PiInstallationConfig,
|
||||
type PiManagementOptions,
|
||||
type PiManagementStatus,
|
||||
} from "../api/pi-management";
|
||||
import { Button } from "../components/ui/button";
|
||||
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../components/ui/dialog";
|
||||
@@ -143,13 +142,11 @@ export function PiManagement({ open, onClose }: { open: boolean; onClose: () =>
|
||||
|
||||
const saveMutation = useMutation({
|
||||
mutationFn: savePiManagementConfig,
|
||||
onSuccess: (saved) => {
|
||||
onSuccess: async (saved) => {
|
||||
const config = { provider: saved.provider, model: saved.model, reasoning: saved.reasoning };
|
||||
queryClient.setQueryData<PiManagementStatus>(["pi-management", "status"], (current) => (
|
||||
current ? { ...current, config } : current
|
||||
));
|
||||
setDraft(config);
|
||||
setSmokeState(undefined);
|
||||
await queryClient.invalidateQueries({ queryKey: ["pi-management", "status"] });
|
||||
setFeedback({ tone: "success", message: "Defaults saved." });
|
||||
},
|
||||
onError: (error) => setFeedback({ tone: "error", message: errorMessage(error, "Could not save Pi defaults.") }),
|
||||
|
||||
Reference in New Issue
Block a user