Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
akanshaaa19 committed Nov 5, 2024
1 parent 5ae1792 commit de1b4cc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ export const AssistantOptions = ({ currentId, options, setOptions }: AssistantOp
const { refetch, data } = useQuery(GET_ASSISTANT_FILES, {
variables: { assistantId: currentId },
onCompleted: ({ assistant }) => {
const attachedFiles = assistant.assistant.vectorStore.files;
setFiles([...files, ...attachedFiles.map((item: any) => ({ ...item, attached: true }))]);
if (assistant.assistant.vectorStore) {
const attachedFiles = assistant.assistant.vectorStore.files;
setFiles([...files, ...attachedFiles.map((item: any) => ({ ...item, attached: true }))]);
}
},
});

Expand Down

0 comments on commit de1b4cc

Please sign in to comment.