@lobehub/chat 0.82.3 → 0.82.4
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 0.82.4](https://github.com/lobehub/lobe-chat/compare/v0.82.3...v0.82.4)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-09-29**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: 修正 localStorage 不存在造成设置页刷新 500 保存的问题.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: 修正 localStorage 不存在造成设置页刷新 500 保存的问题 ([b894cc8](https://github.com/lobehub/lobe-chat/commit/b894cc8))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.82.3](https://github.com/lobehub/lobe-chat/compare/v0.82.2...v0.82.3)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2023-09-29**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.82.
|
|
3
|
+
"version": "0.82.4",
|
|
4
4
|
"description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chatbot",
|
|
@@ -2,6 +2,7 @@ import { StorageValue } from 'zustand/middleware/persist';
|
|
|
2
2
|
|
|
3
3
|
export const createLocalStorage = <State extends any>() => ({
|
|
4
4
|
getItem: <T extends State>(name: string): StorageValue<T> | undefined => {
|
|
5
|
+
if (!global.localStorage) return undefined;
|
|
5
6
|
const string = localStorage.getItem(name);
|
|
6
7
|
|
|
7
8
|
if (string) return JSON.parse(string) as StorageValue<T>;
|
|
@@ -9,9 +10,9 @@ export const createLocalStorage = <State extends any>() => ({
|
|
|
9
10
|
return undefined;
|
|
10
11
|
},
|
|
11
12
|
removeItem: (name: string) => {
|
|
12
|
-
localStorage.removeItem(name);
|
|
13
|
+
if (global.localStorage) localStorage.removeItem(name);
|
|
13
14
|
},
|
|
14
15
|
setItem: <T extends State>(name: string, state: T, version: number | undefined) => {
|
|
15
|
-
localStorage.setItem(name, JSON.stringify({ state, version }));
|
|
16
|
+
if (global.localStorage) localStorage.setItem(name, JSON.stringify({ state, version }));
|
|
16
17
|
},
|
|
17
18
|
});
|