Skip to content

Commit a8d1d96

Browse files
Fix: Communitites Tab is displayed based communitites length
1 parent 0d09547 commit a8d1d96

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

frontend/src/components/ChatBot/ChatInfoModal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,11 @@ const ChatInfoModal: React.FC<chatInfoMessage> = ({
250250
) : (
251251
<></>
252252
)}
253-
{mode === chatModeLables.entity_vector ? <Tabs.Tab tabId={7}>Communities</Tabs.Tab> : <></>}
253+
{mode === chatModeLables.entity_vector && communities.length ? (
254+
<Tabs.Tab tabId={7}>Communities</Tabs.Tab>
255+
) : (
256+
<></>
257+
)}
254258
<Tabs.Tab tabId={8}>Evaluation Metrics</Tabs.Tab>
255259
</>
256260
)}

frontend/src/components/ChatBot/ChatModeToggle.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ export default function ChatModeToggle({
4747
const memoizedChatModes = useMemo(() => {
4848
return isGdsActive && isCommunityAllowed
4949
? AvailableModes
50-
: AvailableModes?.filter(
51-
(m) => !m.mode.includes(chatModeLables.global_vector)
52-
);
50+
: AvailableModes?.filter((m) => !m.mode.includes(chatModeLables.global_vector));
5351
}, [isGdsActive, isCommunityAllowed]);
5452
const menuItems = useMemo(() => {
5553
return memoizedChatModes?.map((m) => {

0 commit comments

Comments
 (0)