mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 09:32:22 +03:00
fix(frontend): remove current brain id when click on create brain (#2906)
# 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:
parent
25178b2c2e
commit
5ce0f6ac87
@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { useFromConnectionsContext } from "@/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/components/FromConnections/FromConnectionsProvider/hooks/useFromConnectionContext";
|
||||
import { Modal } from "@/lib/components/ui/Modal/Modal";
|
||||
import { addBrainDefaultValues } from "@/lib/config/defaultBrainConfig";
|
||||
import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext";
|
||||
import { useKnowledgeToFeedContext } from "@/lib/context/KnowledgeToFeedProvider/hooks/useKnowledgeToFeedContext";
|
||||
import { useUserData } from "@/lib/hooks/useUserData";
|
||||
|
||||
@ -21,6 +22,7 @@ export const AddBrainModal = (): JSX.Element => {
|
||||
const { t } = useTranslation(["translation", "brain", "config"]);
|
||||
const { userIdentityData } = useUserData();
|
||||
const { currentStep, steps } = useBrainCreationSteps();
|
||||
const { setCurrentBrainId } = useBrainContext();
|
||||
const {
|
||||
isBrainCreationModalOpened,
|
||||
setIsBrainCreationModalOpened,
|
||||
@ -48,6 +50,9 @@ export const AddBrainModal = (): JSX.Element => {
|
||||
setOpenedConnections([]);
|
||||
methods.reset(defaultValues);
|
||||
removeAllKnowledgeToFeed();
|
||||
if (isBrainCreationModalOpened) {
|
||||
setCurrentBrainId(null);
|
||||
}
|
||||
}, [isBrainCreationModalOpened]);
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user