mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-29 01:25:33 +08:00
feat(claude): show proxy hint when switching to OpenAI Chat format provider
Display an info toast when switching to a provider that uses OpenAI Chat format (apiFormat === "openai_chat"), reminding users to enable the proxy service. Move toast logic from mutation to useProviderActions for better control over notification content based on provider properties.
This commit is contained in:
@@ -171,17 +171,8 @@ export const useSwitchProviderMutation = (appId: AppId) => {
|
||||
);
|
||||
}
|
||||
|
||||
// OpenCode: show "added to config" message instead of "switched"
|
||||
const messageKey =
|
||||
appId === "opencode"
|
||||
? "notifications.addToConfigSuccess"
|
||||
: "notifications.switchSuccess";
|
||||
const defaultMessage =
|
||||
appId === "opencode" ? "已添加到配置" : "切换供应商成功";
|
||||
|
||||
toast.success(t(messageKey, { defaultValue: defaultMessage }), {
|
||||
closeButton: true,
|
||||
});
|
||||
// Note: Success toast is handled by useProviderActions.switchProvider
|
||||
// to allow customization based on provider properties (e.g., apiFormat)
|
||||
},
|
||||
onError: (error: Error) => {
|
||||
const detail = extractErrorMessage(error) || t("common.unknown");
|
||||
|
||||
Reference in New Issue
Block a user