From 0774b9a8236a23bac38c59c22e5e79397ff140f5 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Fri, 22 Apr 2022 15:08:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E6=89=93=E5=BC=80=E6=89=BE=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/redux/hooks/useGroup.ts | 4 ++-- web/src/routes/Main/Content/Group/Panel.tsx | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/shared/redux/hooks/useGroup.ts b/shared/redux/hooks/useGroup.ts index a5e55a70..5310ab56 100644 --- a/shared/redux/hooks/useGroup.ts +++ b/shared/redux/hooks/useGroup.ts @@ -40,7 +40,7 @@ export function useGroupMemberInfos(groupId: string): UserBaseInfo[] { export function useGroupPanels(groupId: string): GroupPanel[] { const groupInfo = useGroupInfo(groupId); - return useMemo(() => groupInfo?.panels ?? [], [groupId]); + return useMemo(() => groupInfo?.panels ?? [], [groupInfo]); } /** @@ -54,7 +54,7 @@ export function useGroupPanelInfo( return useMemo( () => panels.find((p) => p.id === panelId) ?? null, - [groupId, panelId] + [groupId, panelId, panels] ); } diff --git a/web/src/routes/Main/Content/Group/Panel.tsx b/web/src/routes/Main/Content/Group/Panel.tsx index 0a80058f..897bcf3b 100644 --- a/web/src/routes/Main/Content/Group/Panel.tsx +++ b/web/src/routes/Main/Content/Group/Panel.tsx @@ -1,5 +1,6 @@ import { GroupPluginPanel } from '@/components/Panel/group/PluginPanel'; import { TextPanel } from '@/components/Panel/group/TextPanel'; +import { Problem } from '@/components/Problem'; import { Alert } from 'antd'; import React from 'react'; import { @@ -32,13 +33,7 @@ export const GroupPanelRender: React.FC = React.memo( } if (panelInfo === null) { - return ( - - ); + return ; } if (panelInfo.type === GroupPanelType.TEXT) {