mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-06 11:22:48 +08:00
fix(proxy): add fallback recovery for orphaned takeover state
- Detect takeover residue in Live configs even when proxy is not running - Implement 3-tier fallback: backup → SSOT → cleanup placeholders - Only delete backup after successful restore to prevent data loss - Fix EditProviderDialog to check current app's takeover status only
This commit is contained in:
+1
-7
@@ -70,12 +70,6 @@ function App() {
|
||||
const { isRunning: isProxyRunning, takeoverStatus } = useProxyStatus();
|
||||
// 当前应用的代理是否开启
|
||||
const isCurrentAppTakeoverActive = takeoverStatus?.[activeApp] || false;
|
||||
// 任意应用的代理是否开启
|
||||
const isTakeoverActive =
|
||||
takeoverStatus?.claude ||
|
||||
takeoverStatus?.codex ||
|
||||
takeoverStatus?.gemini ||
|
||||
false;
|
||||
|
||||
// 获取供应商列表,当代理服务运行时自动刷新
|
||||
const { data, isLoading, refetch } = useProvidersQuery(activeApp, {
|
||||
@@ -605,7 +599,7 @@ function App() {
|
||||
}}
|
||||
onSubmit={handleEditProvider}
|
||||
appId={activeApp}
|
||||
isProxyTakeover={isProxyRunning && isTakeoverActive}
|
||||
isProxyTakeover={isProxyRunning && isCurrentAppTakeoverActive}
|
||||
/>
|
||||
|
||||
{usageProvider && (
|
||||
|
||||
Reference in New Issue
Block a user