@lobehub/chat 1.82.6 → 1.82.7
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 +25 -0
- package/changelog/v1.json +9 -0
- package/package.json +1 -1
- package/src/features/PWAInstall/index.tsx +25 -2
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.82.7](https://github.com/lobehub/lobe-chat/compare/v1.82.6...v1.82.7)
|
6
|
+
|
7
|
+
<sup>Released on **2025-04-25**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Pwa-install cause mobile infinity scroll.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's fixed
|
19
|
+
|
20
|
+
- **misc**: Pwa-install cause mobile infinity scroll, closes [#7521](https://github.com/lobehub/lobe-chat/issues/7521) [#7408](https://github.com/lobehub/lobe-chat/issues/7408) ([39f5bc7](https://github.com/lobehub/lobe-chat/commit/39f5bc7))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.82.6](https://github.com/lobehub/lobe-chat/compare/v1.82.5...v1.82.6)
|
6
31
|
|
7
32
|
<sup>Released on **2025-04-24**</sup>
|
package/changelog/v1.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.82.
|
3
|
+
"version": "1.82.7",
|
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,9 +1,12 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
3
|
import dynamic from 'next/dynamic';
|
4
|
-
import {
|
4
|
+
import { pwaInstallHandler } from 'pwa-install-handler';
|
5
|
+
import { memo, useEffect, useState } from 'react';
|
5
6
|
|
6
7
|
import { usePlatform } from '@/hooks/usePlatform';
|
8
|
+
import { useGlobalStore } from '@/store/global';
|
9
|
+
import { systemStatusSelectors } from '@/store/global/selectors';
|
7
10
|
import { useUserStore } from '@/store/user';
|
8
11
|
|
9
12
|
const Install: any = dynamic(() => import('./Install'), {
|
@@ -13,8 +16,28 @@ const Install: any = dynamic(() => import('./Install'), {
|
|
13
16
|
const PWAInstall = memo(() => {
|
14
17
|
const { isPWA, isSupportInstallPWA } = usePlatform();
|
15
18
|
const isShowPWAGuide = useUserStore((s) => s.isShowPWAGuide);
|
19
|
+
const hidePWAInstaller = useGlobalStore((s) => systemStatusSelectors.hidePWAInstaller(s));
|
20
|
+
const [canInstallFromPWAInstallHandler, setCanInstallFromPWAInstallHandler] = useState<
|
21
|
+
boolean | undefined
|
22
|
+
>();
|
16
23
|
|
17
|
-
|
24
|
+
useEffect(() => {
|
25
|
+
pwaInstallHandler.addListener((canInstall) => {
|
26
|
+
setCanInstallFromPWAInstallHandler(canInstall);
|
27
|
+
});
|
28
|
+
return () => {
|
29
|
+
pwaInstallHandler.removeListener(setCanInstallFromPWAInstallHandler);
|
30
|
+
};
|
31
|
+
}, []);
|
32
|
+
|
33
|
+
if (
|
34
|
+
isPWA ||
|
35
|
+
!isShowPWAGuide ||
|
36
|
+
!isSupportInstallPWA ||
|
37
|
+
hidePWAInstaller ||
|
38
|
+
canInstallFromPWAInstallHandler === false
|
39
|
+
)
|
40
|
+
return null;
|
18
41
|
|
19
42
|
// only when the user is suitable for the pwa install and not install the pwa
|
20
43
|
// then show the installation guide
|