now is working in settings

This commit is contained in:
TomasMatarazzo
2024-04-22 16:16:19 -03:00
parent 260e328cc1
commit 480825ddd7
3 changed files with 13 additions and 14 deletions

View File

@@ -31,7 +31,8 @@ import {
selectConversations,
setConversations,
selectConversationId,
selectModalState,
selectModalStateDeleteConv,
setModalStateDeleteConv,
} from './preferences/preferenceSlice';
import {
setConversation,
@@ -69,7 +70,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
const docs = useSelector(selectSourceDocs);
const selectedDocs = useSelector(selectSelectedDocs);
const conversations = useSelector(selectConversations);
const modalState = useSelector(selectModalState);
const modalStateDeleteConv = useSelector(selectModalStateDeleteConv);
const conversationId = useSelector(selectConversationId);
const { isMobile } = useMediaQuery();
@@ -80,9 +81,6 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
const [apiKeyModalState, setApiKeyModalState] =
useState<ActiveState>('INACTIVE');
const [deleteConvModalState, setDeleteConvState] =
useState<ActiveState>('INACTIVE');
const isSelectedDocsSet = useSelector(selectSelectedDocsStatus);
const [selectedDocsModalState, setSelectedDocsModalState] =
useState<ActiveState>(isSelectedDocsSet ? 'INACTIVE' : 'ACTIVE');
@@ -102,8 +100,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
}, [conversations, dispatch]);
useEffect(() => {
console.log(modalState);
}, [modalState]);
console.log(modalStateDeleteConv);
}, [modalStateDeleteConv]);
async function fetchConversations() {
return await getConversations()
@@ -407,8 +405,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
isCancellable={isApiKeySet}
/>
<DeleteConvModal
modalState={modalState}
setModalState={setDeleteConvState}
modalState={modalStateDeleteConv}
setModalState={setModalStateDeleteConv}
handleDeleteAllConv={handleDeleteAllConversations}
/>
<Upload