From 6dba794198575952b3b88e1fbdd8fa3a0d05d07b Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 11 May 2024 17:24:39 +0800 Subject: [PATCH] fix: fix quick switcher layer problem and filter group panel type because should not direct open --- .../src/components/QuickSwitcher/index.tsx | 2 +- .../useQuickSwitcherAllAction.ts | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/web/src/components/QuickSwitcher/index.tsx b/client/web/src/components/QuickSwitcher/index.tsx index fd5dde5c..e5a9826e 100644 --- a/client/web/src/components/QuickSwitcher/index.tsx +++ b/client/web/src/components/QuickSwitcher/index.tsx @@ -54,7 +54,7 @@ const QuickSwitcher: React.FC = React.memo(() => { return (
{ - group.panels.forEach((panel) => { - list.push({ - key: `qs#grouppanel#${panel.id}`, - label: `[${group.name}] ${panel.name}`, - source: 'core', - action: ({ navigate }) => { - navigate(`/main/group/${group._id}/${panel.id}`); - }, + group.panels + .filter((p) => p.type !== model.group.GroupPanelType.GROUP) + .forEach((panel) => { + list.push({ + key: `qs#grouppanel#${panel.id}`, + label: `[${group.name}] ${panel.name}`, + source: 'core', + action: ({ navigate }) => { + navigate(`/main/group/${group._id}/${panel.id}`); + }, + }); }); - }); }); return list;