Browse Source

取消动态加载

李富豪 5 months ago
parent
commit
078ccebf06
1 changed files with 27 additions and 30 deletions
  1. 27 30
      app/components/home.tsx

+ 27 - 30
app/components/home.tsx

@@ -22,9 +22,6 @@ import { AuthPage } from "./auth";
 import { getClientConfig } from "../config/client";
 import { type ClientApi, getClientApi } from "../client/api";
 import { useAccessStore } from "../store";
-import HomeApp from "./DeekSeekHome";
-import { Chat } from "./chat";
-import { Chat as DeepSeekChat } from "./DeepSeekChat";
 
 export function Loading() {
   /** second版本注释掉进度条 */
@@ -103,25 +100,25 @@ const Settings = dynamic(
   }
 );
 
-// const Chat = dynamic(
-//   async () => {
-//     await delayer();
-//     return (await import("./chat")).Chat
-//   },
-//   {
-//     loading: () => <Loading />,
-//   }
-// );
-
-// const DeepSeekChat = dynamic(
-//   async () => {
-//     await delayer();
-//     return (await import("./DeepSeekChat")).Chat
-//   },
-//   {
-//     loading: () => <Loading />,
-//   }
-// );
+const Chat = dynamic(
+  async () => {
+    await delayer();
+    return (await import("./chat")).Chat
+  },
+  {
+    loading: () => <Loading />,
+  }
+);
+
+const DeepSeekChat = dynamic(
+  async () => {
+    await delayer();
+    return (await import("./DeepSeekChat")).Chat
+  },
+  {
+    loading: () => <Loading />,
+  }
+);
 
 const Record = dynamic(
   async () => {
@@ -133,14 +130,14 @@ const Record = dynamic(
   }
 );
 
-// const HomeApp = dynamic(
-//   async () => {
-//     return (await import("./DeekSeekHome"))
-//   },
-//   {
-//     loading: () => <Loading />,
-//   }
-// );
+const HomeApp = dynamic(
+  async () => {
+    return (await import("./DeekSeekHome"))
+  },
+  {
+    loading: () => <Loading />,
+  }
+);
 
 const NewChat = dynamic(
   async () => {