From f105fd1b2c03359884e698b47ef07d82953be3a9 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 8 Sep 2024 23:19:10 +0100 Subject: [PATCH] lint: final fix --- frontend/src/components/SourceDropdown.tsx | 2 +- frontend/src/conversation/conversationHandlers.ts | 2 +- frontend/src/preferences/SelectDocsModal.tsx | 4 +--- frontend/src/settings/Documents.tsx | 6 ++---- frontend/src/settings/index.tsx | 2 +- frontend/src/store.ts | 9 +++------ frontend/src/upload/Upload.tsx | 4 ++-- 7 files changed, 11 insertions(+), 18 deletions(-) diff --git a/frontend/src/components/SourceDropdown.tsx b/frontend/src/components/SourceDropdown.tsx index e76b9664..d5146da5 100644 --- a/frontend/src/components/SourceDropdown.tsx +++ b/frontend/src/components/SourceDropdown.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Trash from '../assets/trash.svg'; import Arrow2 from '../assets/dropdown-arrow.svg'; -import { Doc } from '../preferences/preferenceApi'; +import { Doc } from '../models/misc'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; type Props = { diff --git a/frontend/src/conversation/conversationHandlers.ts b/frontend/src/conversation/conversationHandlers.ts index eaea1b4f..335f07e9 100644 --- a/frontend/src/conversation/conversationHandlers.ts +++ b/frontend/src/conversation/conversationHandlers.ts @@ -1,5 +1,5 @@ import conversationService from '../api/services/conversationService'; -import { Doc } from '../preferences/preferenceApi'; +import { Doc } from '../models/misc'; import { Answer, FEEDBACK, RetrievalPayload } from './conversationModels'; export function handleFetchAnswer( diff --git a/frontend/src/preferences/SelectDocsModal.tsx b/frontend/src/preferences/SelectDocsModal.tsx index f2aa4754..97d7626d 100644 --- a/frontend/src/preferences/SelectDocsModal.tsx +++ b/frontend/src/preferences/SelectDocsModal.tsx @@ -93,9 +93,7 @@ export default function APIKeyModal({ }} className="h-10 w-full cursor-pointer border-x-2 border-b-2 hover:bg-gray-100" > -

- {doc.name} {doc.version} -

+

{doc.name}

); } diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Documents.tsx index 19bde1fa..342e2f52 100644 --- a/frontend/src/settings/Documents.tsx +++ b/frontend/src/settings/Documents.tsx @@ -61,12 +61,10 @@ const Documents: React.FC = ({ {document.tokens ? formatTokens(+document.tokens) : ''} - {document.location === 'remote' - ? 'Pre-loaded' - : 'Private'} + {document.type === 'remote' ? 'Pre-loaded' : 'Private'} - {document.location !== 'remote' && ( + {document.type !== 'remote' && ( Delete d.location.toLowerCase() === 'local'), + data?.find((d) => d.type?.toLowerCase() === 'local'), ), ); }); @@ -137,7 +137,7 @@ function Upload({ dispatch(setSourceDocs(data)); dispatch( setSelectedDocs( - data?.find((d) => d.location.toLowerCase() === 'local'), + data?.find((d) => d.type?.toLowerCase() === 'local'), ), ); });