quivr/frontend/app/App.tsx
Mamadou DICKO 1ec736b357
fix: fix some bugs (#1201)
* feat(brainSettings): add feed process instrcution to knowledge tab

* feat: prevent default brain auto fetch

* feat: prevent chat submision on submit button click

* feat: remove unrelevant toast

* feat: remove duplicated GA initialization

* feat: add brain name in notifications

* fix(test): update analytics import path

* refactor: move ChatsList utils to ChatsList directory

* fix(test): update chatlist tests
2023-09-18 21:28:07 +02:00

39 lines
1.2 KiB
TypeScript

"use client";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { PropsWithChildren, useEffect } from "react";
import Footer from "@/lib/components/Footer";
import { NavBar } from "@/lib/components/NavBar";
import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext";
import { useSupabase } from "@/lib/context/SupabaseProvider";
import { UpdateMetadata } from "@/lib/helpers/updateMetadata";
import { usePageTracking } from "@/services/analytics/june/usePageTracking";
import "../lib/config/LocaleConfig/i18n";
const queryClient = new QueryClient();
// This wrapper is used to make effect calls at a high level in app rendering.
export const App = ({ children }: PropsWithChildren): JSX.Element => {
const { fetchAllBrains, fetchDefaultBrain, fetchPublicPrompts } =
useBrainContext();
const { session } = useSupabase();
usePageTracking();
useEffect(() => {
void fetchAllBrains();
void fetchDefaultBrain();
void fetchPublicPrompts();
}, [session?.user.id]);
return (
<QueryClientProvider client={queryClient}>
<NavBar />
<div className="flex-1">{children}</div>
<Footer />
<UpdateMetadata />
</QueryClientProvider>
);
};