From ddae84e2b1be20ec02d7020e72de05c1c40ad3f4 Mon Sep 17 00:00:00 2001 From: Jeff Gu Date: Tue, 14 Apr 2026 18:47:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(channels):=20=E4=BF=AE=E5=A4=8D=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E6=A8=A1=E5=9E=8B=E9=80=89=E6=8B=A9=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BB=A5=E5=A4=84=E7=90=86=E7=A9=BA=E6=A8=A1=E5=9E=8B=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Channels.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Channels.tsx b/frontend/src/pages/Channels.tsx index 3db6b67..965e7db 100644 --- a/frontend/src/pages/Channels.tsx +++ b/frontend/src/pages/Channels.tsx @@ -336,12 +336,14 @@ const buildInitialFetchedModelSelection = ( candidates: FetchedModelCandidate[], currentModels: ChannelModelMapping[], ): string[] => { + if (currentModels.length === 0) { + return candidates.map((candidate) => candidate.id); + } + const currentModelIds = new Set(currentModels.map((model) => model.id)); - const matchedIds = candidates + return candidates .filter((candidate) => currentModelIds.has(candidate.id)) .map((candidate) => candidate.id); - - return matchedIds.length > 0 ? matchedIds : candidates.map((candidate) => candidate.id); }; const trimSlashes = (value: string): string => value.replace(/^\/+|\/+$/g, "");