mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
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:
@@ -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"), {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"), {
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user