@lobehub/chat 1.2.4 → 1.2.6

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,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.2.6](https://github.com/lobehub/lobe-chat/compare/v1.2.5...v1.2.6)
6
+
7
+ <sup>Released on **2024-07-03**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Clerk provider refreshes continously.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Clerk provider refreshes continously, closes [#3131](https://github.com/lobehub/lobe-chat/issues/3131) ([ffbb399](https://github.com/lobehub/lobe-chat/commit/ffbb399))
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
+
30
+ ### [Version 1.2.5](https://github.com/lobehub/lobe-chat/compare/v1.2.4...v1.2.5)
31
+
32
+ <sup>Released on **2024-07-02**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Fix clerk appearance is not applied correctly.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Fix clerk appearance is not applied correctly, closes [#3105](https://github.com/lobehub/lobe-chat/issues/3105) ([cf9c145](https://github.com/lobehub/lobe-chat/commit/cf9c145))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 1.2.4](https://github.com/lobehub/lobe-chat/compare/v1.2.3...v1.2.4)
6
56
 
7
57
  <sup>Released on **2024-07-02**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
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",
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { ClerkProvider } from '@clerk/nextjs';
4
- import { PropsWithChildren, memo, useMemo } from 'react';
4
+ import { PropsWithChildren, memo, useEffect, useMemo, useState, useTransition } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
7
7
  import UserUpdater from './UserUpdater';
@@ -15,6 +15,18 @@ const Clerk = memo(({ children }: PropsWithChildren) => {
15
15
 
16
16
  const localization = useMemo(() => getResourceBundle(language, 'clerk'), [language]);
17
17
 
18
+ // When useAppearance returns different result during SSR vs. client-side (when theme mode is auto), the appearance is not applied
19
+ // It's because Clerk internally re-applies SSR props after transition which overrides client-side props, see https://github.com/clerk/javascript/blob/main/packages/nextjs/src/app-router/client/ClerkProvider.tsx
20
+ // This re-renders the provider after transition to make sure client-side props are always applied
21
+ const [count, setCount] = useState(0);
22
+ const [isPending, startTransition] = useTransition();
23
+ useEffect(() => {
24
+ if (count || isPending) return;
25
+ startTransition(() => {
26
+ setCount((count) => count + 1);
27
+ });
28
+ }, [count, setCount, isPending, startTransition]);
29
+
18
30
  return (
19
31
  <ClerkProvider appearance={appearance} localization={localization}>
20
32
  {children}