From 9437e953151d7742c39aa9b1a0a83fc71bb3f19e Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 1 Nov 2024 18:54:17 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=91=20fix:=20Access=20Control=20for=20?= =?UTF-8?q?Bookmarks=20(UI)=20(#4612)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Nav/Bookmarks/BookmarkNav.tsx | 15 +-------------- client/src/components/Nav/Nav.tsx | 12 +++++++----- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/client/src/components/Nav/Bookmarks/BookmarkNav.tsx b/client/src/components/Nav/Bookmarks/BookmarkNav.tsx index 452a97a7de..99d435ab70 100644 --- a/client/src/components/Nav/Bookmarks/BookmarkNav.tsx +++ b/client/src/components/Nav/Bookmarks/BookmarkNav.tsx @@ -1,7 +1,5 @@ import { type FC } from 'react'; import { useRecoilValue } from 'recoil'; -import { useLocation } from 'react-router-dom'; -import { TConversation } from 'librechat-data-provider'; import { Menu, MenuButton, MenuItems } from '@headlessui/react'; import { BookmarkFilledIcon, BookmarkIcon } from '@radix-ui/react-icons'; import { BookmarkContext } from '~/Providers/BookmarkContext'; @@ -19,19 +17,8 @@ type BookmarkNavProps = { const BookmarkNav: FC = ({ tags, setTags, isSmallScreen }: BookmarkNavProps) => { const localize = useLocalize(); - const location = useLocation(); - const { data } = useGetConversationTags(); - - const activeConvo = useRecoilValue(store.conversationByIndex(0)); - const globalConvo = useRecoilValue(store.conversation) ?? ({} as TConversation); - - let conversation: TConversation | null | undefined; - if (location.state?.from?.pathname.includes('/chat')) { - conversation = globalConvo; - } else { - conversation = activeConvo; - } + const conversation = useRecoilValue(store.conversationByIndex(0)); return ( diff --git a/client/src/components/Nav/Nav.tsx b/client/src/components/Nav/Nav.tsx index ffc2bbadce..9f5ac601c7 100644 --- a/client/src/components/Nav/Nav.tsx +++ b/client/src/components/Nav/Nav.tsx @@ -176,11 +176,13 @@ const Nav = ({ {isSearchEnabled === true && ( )} - + {hasAccessToBookmarks === true && ( + + )} } />