refactor: remove backup path display from OpenClaw save toasts

Backup paths are internal implementation details not actionable by users.
Simplify toast notifications to show only success/failure messages.
This commit is contained in:
Jason
2026-03-09 15:00:30 +08:00
parent 99ef870077
commit 44096b0e44
5 changed files with 51 additions and 37 deletions
@@ -169,15 +169,8 @@ const AgentsDefaultsPanel: React.FC = () => {
if (concNum !== undefined) updated.maxConcurrent = concNum;
else delete updated.maxConcurrent;
const outcome = await saveAgentsMutation.mutateAsync(updated);
toast.success(t("openclaw.agents.saveSuccess"), {
description: outcome.backupPath
? t("openclaw.backupCreated", {
path: outcome.backupPath,
defaultValue: "Backup created: {{path}}",
})
: undefined,
});
await saveAgentsMutation.mutateAsync(updated);
toast.success(t("openclaw.agents.saveSuccess"));
} catch (error) {
const detail = extractErrorMessage(error);
toast.error(t("openclaw.agents.saveFailed"), {
+2 -9
View File
@@ -41,15 +41,8 @@ const EnvPanel: React.FC = () => {
const handleSave = async () => {
try {
const env = parseOpenClawEnvEditorValue(editorValue);
const outcome = await saveEnvMutation.mutateAsync(env);
toast.success(t("openclaw.env.saveSuccess"), {
description: outcome.backupPath
? t("openclaw.backupCreated", {
path: outcome.backupPath,
defaultValue: "Backup created: {{path}}",
})
: undefined,
});
await saveEnvMutation.mutateAsync(env);
toast.success(t("openclaw.env.saveSuccess"));
} catch (error) {
const detail = extractErrorMessage(error);
let description = detail || undefined;
+2 -9
View File
@@ -85,15 +85,8 @@ const ToolsPanel: React.FC = () => {
deny: denyList.map((item) => item.value).filter((s) => s.trim()),
};
const outcome = await saveToolsMutation.mutateAsync(newConfig);
toast.success(t("openclaw.tools.saveSuccess"), {
description: outcome.backupPath
? t("openclaw.backupCreated", {
path: outcome.backupPath,
defaultValue: "Backup created: {{path}}",
})
: undefined,
});
await saveToolsMutation.mutateAsync(newConfig);
toast.success(t("openclaw.tools.saveSuccess"));
} catch (error) {
const detail = extractErrorMessage(error);
toast.error(t("openclaw.tools.saveFailed"), {
+2 -10
View File
@@ -261,7 +261,7 @@ export function useProviderActions(activeApp: AppId) {
};
try {
const outcome = await openclawApi.setDefaultModel(model);
await openclawApi.setDefaultModel(model);
await queryClient.invalidateQueries({
queryKey: openclawKeys.defaultModel,
});
@@ -272,15 +272,7 @@ export function useProviderActions(activeApp: AppId) {
t("notifications.openclawDefaultModelSet", {
defaultValue: "已设为默认模型",
}),
{
closeButton: true,
description: outcome.backupPath
? t("openclaw.backupCreated", {
path: outcome.backupPath,
defaultValue: "Backup created: {{path}}",
})
: undefined,
},
{ closeButton: true },
);
} catch (error) {
const detail =