fix(frontend): add brain modal integration doestn t work (#2649)

# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
This commit is contained in:
Antoine Dewez 2024-06-10 10:17:06 +02:00 committed by GitHub
parent 11a2e888da
commit ca6c0a86dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -23,8 +23,7 @@ export const BrainRecapStep = (): JSX.Element => {
const { createBrain } = useBrainCreationApi();
const { updateUserIdentity } = useUserApi();
const { userIdentityData } = useUserData();
const { openedConnections, setOpenedConnections } =
useFromConnectionsContext();
const { openedConnections } = useFromConnectionsContext();
const feed = async (): Promise<void> => {
if (!userIdentityData?.onboarded) {
@ -121,7 +120,6 @@ export const BrainRecapStep = (): JSX.Element => {
iconName="add"
onClick={async () => {
await feed();
setOpenedConnections([]);
}}
disabled={
knowledgeToFeed.length === 0 && !userIdentityData?.onboarded

View File

@ -30,6 +30,7 @@ export const useBrainCreationApi = () => {
const { crawlWebsiteHandler, uploadFileHandler } = useKnowledgeToFeedInput();
const { setIsBrainCreationModalOpened, setCreating, currentSelectedBrain } =
useBrainCreationContext();
const { setOpenedConnections } = useFromConnectionsContext();
const [fields, setFields] = useState<
{ name: string; type: string; value: string }[]
>([]);
@ -88,6 +89,7 @@ export const useBrainCreationApi = () => {
setCurrentBrainId(createdBrainId);
setIsBrainCreationModalOpened(false);
setCreating(false);
setOpenedConnections([]);
reset();
void queryClient.invalidateQueries({