@lobehub/chat 1.51.11 → 1.51.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.51.12](https://github.com/lobehub/lobe-chat/compare/v1.51.11...v1.51.12)
6
+
7
+ <sup>Released on **2025-02-07**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Try to fix next-auth issue.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Try to fix next-auth issue, closes [#5813](https://github.com/lobehub/lobe-chat/issues/5813) ([8e316bd](https://github.com/lobehub/lobe-chat/commit/8e316bd))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.51.11](https://github.com/lobehub/lobe-chat/compare/v1.51.10...v1.51.11)
6
31
 
7
32
  <sup>Released on **2025-02-06**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Try to fix next-auth issue."
6
+ ]
7
+ },
8
+ "date": "2025-02-07",
9
+ "version": "1.51.12"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.51.11",
3
+ "version": "1.51.12",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -7,5 +7,3 @@ export const metadata: Metadata = {
7
7
  };
8
8
 
9
9
  export { default } from './loading';
10
-
11
- export const dynamic = 'force-static';
@@ -0,0 +1,30 @@
1
+ 'use client';
2
+
3
+ import { useQueryState } from 'nuqs';
4
+ import { memo, useEffect } from 'react';
5
+
6
+ import { LOBE_URL_IMPORT_NAME } from '@/const/url';
7
+ import { useUserStore } from '@/store/user';
8
+
9
+ const ImportSettings = memo(() => {
10
+ const [importUrlShareSettings, isUserStateInit] = useUserStore((s) => [
11
+ s.importUrlShareSettings,
12
+ s.isUserStateInit,
13
+ ]);
14
+
15
+ // Import settings from the url
16
+ const [searchParam] = useQueryState(LOBE_URL_IMPORT_NAME, {
17
+ clearOnDefault: true,
18
+ defaultValue: '',
19
+ });
20
+
21
+ useEffect(() => {
22
+ // Why use `usUserStateInit`,
23
+ // see: https://github.com/lobehub/lobe-chat/pull/4072
24
+ if (searchParam && isUserStateInit) importUrlShareSettings(searchParam);
25
+ }, [searchParam, isUserStateInit]);
26
+
27
+ return null;
28
+ });
29
+
30
+ export default ImportSettings;
@@ -1,12 +1,10 @@
1
1
  'use client';
2
2
 
3
3
  import { useRouter } from 'next/navigation';
4
- import { useQueryState } from 'nuqs';
5
- import { memo, useEffect } from 'react';
4
+ import { memo } from 'react';
6
5
  import { useTranslation } from 'react-i18next';
7
6
  import { createStoreUpdater } from 'zustand-utils';
8
7
 
9
- import { LOBE_URL_IMPORT_NAME } from '@/const/url';
10
8
  import { useIsMobile } from '@/hooks/useIsMobile';
11
9
  import { useEnabledDataSync } from '@/hooks/useSyncData';
12
10
  import { useAgentStore } from '@/store/agent';
@@ -23,14 +21,11 @@ const StoreInitialization = memo(() => {
23
21
  useTranslation('error');
24
22
 
25
23
  const router = useRouter();
26
- const [isLogin, isSignedIn, useInitUserState, importUrlShareSettings, isUserStateInit] =
27
- useUserStore((s) => [
28
- authSelectors.isLogin(s),
29
- s.isSignedIn,
30
- s.useInitUserState,
31
- s.importUrlShareSettings,
32
- s.isUserStateInit,
33
- ]);
24
+ const [isLogin, isSignedIn, useInitUserState] = useUserStore((s) => [
25
+ authSelectors.isLogin(s),
26
+ s.isSignedIn,
27
+ s.useInitUserState,
28
+ ]);
34
29
 
35
30
  const { serverConfig } = useServerConfigStore();
36
31
 
@@ -81,26 +76,6 @@ const StoreInitialization = memo(() => {
81
76
  useStoreUpdater('isMobile', mobile);
82
77
  useStoreUpdater('router', router);
83
78
 
84
- // Import settings from the url
85
- const [searchParam] = useQueryState(LOBE_URL_IMPORT_NAME, {
86
- clearOnDefault: true,
87
- defaultValue: '',
88
- });
89
-
90
- useEffect(() => {
91
- // Why use `usUserStateInit`,
92
- // see: https://github.com/lobehub/lobe-chat/pull/4072
93
- if (searchParam && isUserStateInit) importUrlShareSettings(searchParam);
94
- }, [searchParam, isUserStateInit]);
95
-
96
- useEffect(() => {
97
- if (mobile) {
98
- router.prefetch('/me');
99
- } else {
100
- router.prefetch('/chat/settings/modal');
101
- }
102
- }, [router, mobile]);
103
-
104
79
  return null;
105
80
  });
106
81
 
@@ -9,6 +9,7 @@ import { getAntdLocale } from '@/utils/locale';
9
9
 
10
10
  import AntdV5MonkeyPatch from './AntdV5MonkeyPatch';
11
11
  import AppTheme from './AppTheme';
12
+ import ImportSettings from './ImportSettings';
12
13
  import Locale from './Locale';
13
14
  import QueryProvider from './Query';
14
15
  import ReactScan from './ReactScan';
@@ -54,8 +55,9 @@ const GlobalLayout = async ({
54
55
  serverConfig={serverConfig}
55
56
  >
56
57
  <QueryProvider>{children}</QueryProvider>
58
+ <StoreInitialization />
57
59
  <Suspense>
58
- <StoreInitialization />
60
+ <ImportSettings />
59
61
  <ReactScan />
60
62
  {process.env.NODE_ENV === 'development' && <DevPanel />}
61
63
  </Suspense>