From 2ffacd929466bdbe8573fa9587191e55df737ce0 Mon Sep 17 00:00:00 2001 From: Henry Li Date: Wed, 11 Jun 2025 17:40:12 +0800 Subject: [PATCH] feat: re-implement configuration at client-side --- web/src/app/layout.tsx | 5 ++++- web/src/core/api/config.ts | 25 +++++++++++++++++++++++++ web/src/core/api/hooks.ts | 13 +++---------- web/src/core/api/rag.ts | 10 +--------- web/src/core/config/index.ts | 1 + web/src/core/config/types.ts | 13 +++++++++++++ 6 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 web/src/core/api/config.ts create mode 100644 web/src/core/config/index.ts create mode 100644 web/src/core/config/types.ts diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index 232aaa7..a199e39 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -8,6 +8,7 @@ import { Geist } from "next/font/google"; import Script from "next/script"; import { ThemeProviderWrapper } from "~/components/deer-flow/theme-provider-wrapper"; +import { loadConfig } from "~/core/api/config"; import { env } from "~/env"; import { Toaster } from "../components/deer-flow/toaster"; @@ -24,12 +25,14 @@ const geist = Geist({ variable: "--font-geist-sans", }); -export default function RootLayout({ +export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode }>) { + const conf = await loadConfig(); return ( + {/* Define isSpace function globally to fix markdown-it issues with Next.js + Turbopack https://github.com/markdown-it/markdown-it/issues/1082#issuecomment-2749656365 */}