From 0398d288ae483c194a7c844d2b72f492adf745ca Mon Sep 17 00:00:00 2001 From: YoVinchen Date: Mon, 22 Dec 2025 23:51:01 +0800 Subject: [PATCH] style: apply prettier formatting to App.tsx and ProviderList.tsx --- src/App.tsx | 30 +++++++++++++---------- src/components/providers/ProviderList.tsx | 4 +-- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index a7c57c0f2..40db2fa2c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -116,7 +116,7 @@ function App() { if (event.appType === activeApp) { await refetch(); } - } + }, ); } catch (error) { console.error("[App] Failed to subscribe provider switch event", error); @@ -146,7 +146,7 @@ function App() { } catch (error) { console.error( "[App] Failed to check environment conflicts on startup:", - error + error, ); } }; @@ -162,7 +162,7 @@ function App() { if (migrated) { toast.success( t("migration.success", { defaultValue: "配置迁移成功" }), - { closeButton: true } + { closeButton: true }, ); } } catch (error) { @@ -183,10 +183,10 @@ function App() { // 合并新检测到的冲突 setEnvConflicts((prev) => { const existingKeys = new Set( - prev.map((c) => `${c.varName}:${c.sourcePath}`) + prev.map((c) => `${c.varName}:${c.sourcePath}`), ); const newConflicts = conflicts.filter( - (c) => !existingKeys.has(`${c.varName}:${c.sourcePath}`) + (c) => !existingKeys.has(`${c.varName}:${c.sourcePath}`), ); return [...prev, ...newConflicts]; }); @@ -198,7 +198,7 @@ function App() { } catch (error) { console.error( "[App] Failed to check environment conflicts on app switch:", - error + error, ); } }; @@ -259,7 +259,7 @@ function App() { (p) => p.sortIndex !== undefined && p.sortIndex >= newSortIndex! && - p.id !== provider.id + p.id !== provider.id, ) .map((p) => ({ id: p.id, @@ -275,7 +275,7 @@ function App() { toast.error( t("provider.sortUpdateFailed", { defaultValue: "排序更新失败", - }) + }), ); return; // 如果排序更新失败,不继续添加 } @@ -345,7 +345,9 @@ function App() { /> ); case "agents": - return setCurrentView("providers")} />; + return ( + setCurrentView("providers")} /> + ); default: return (
@@ -366,7 +368,9 @@ function App() { appId={activeApp} isLoading={isLoading} isProxyRunning={isProxyRunning} - isProxyTakeover={isProxyRunning && isCurrentAppTakeoverActive} + isProxyTakeover={ + isProxyRunning && isCurrentAppTakeoverActive + } activeProviderId={activeProviderId} onSwitch={switchProvider} onEdit={setEditingProvider} @@ -430,7 +434,7 @@ function App() { } catch (error) { console.error( "[App] Failed to re-check conflicts after deletion:", - error + error, ); } }} @@ -487,7 +491,7 @@ function App() { "text-xl font-semibold transition-colors", isProxyRunning && isCurrentAppTakeoverActive ? "text-emerald-500 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-300" - : "text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300" + : "text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300", )} > CC Switch @@ -569,7 +573,7 @@ function App() { "transition-all duration-200 ease-in-out overflow-hidden", hasSkillsSupport ? "opacity-100 w-8 scale-100 px-2" - : "opacity-0 w-0 scale-75 pointer-events-none px-0 -ml-1" + : "opacity-0 w-0 scale-75 pointer-events-none px-0 -ml-1", )} title={t("skills.manage")} > diff --git a/src/components/providers/ProviderList.tsx b/src/components/providers/ProviderList.tsx index 89e1392e7..f4c916358 100644 --- a/src/components/providers/ProviderList.tsx +++ b/src/components/providers/ProviderList.tsx @@ -67,7 +67,7 @@ export function ProviderList({ const { t } = useTranslation(); const { sortedProviders, sensors, handleDragEnd } = useDragSort( providers, - appId + appId, ); // 流式健康检查 @@ -158,7 +158,7 @@ export function ProviderList({ return sortedProviders.filter((provider) => { const fields = [provider.name, provider.notes, provider.websiteUrl]; return fields.some((field) => - field?.toString().toLowerCase().includes(keyword) + field?.toString().toLowerCase().includes(keyword), ); }); }, [searchTerm, sortedProviders]);