@fe-free/core 2.1.2 → 2.1.3

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
@@ -1,5 +1,12 @@
1
1
  # @fe-free/core
2
2
 
3
+ ## 2.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: chat and useLocalforageState
8
+ - @fe-free/tool@2.1.3
9
+
3
10
  ## 2.1.2
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/core",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "",
5
5
  "main": "./src/index.ts",
6
6
  "author": "",
@@ -39,7 +39,7 @@
39
39
  "remark-gfm": "^4.0.1",
40
40
  "vanilla-jsoneditor": "^0.23.1",
41
41
  "zustand": "^4.5.4",
42
- "@fe-free/tool": "2.1.2"
42
+ "@fe-free/tool": "2.1.3"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@ant-design/pro-components": "^2.8.7",
@@ -251,9 +251,13 @@ function ChartBlockBase(props: any) {
251
251
  function ChartBlock(props: any) {
252
252
  const { children } = props;
253
253
 
254
+ // 大模型会返回一些奇怪字符,需要去掉
255
+ // 不间断空格
256
+ const content = children.replace(/ /g, '');
257
+
254
258
  return (
255
259
  <ErrorBoundary>
256
- <ChartBlockBase>{children}</ChartBlockBase>
260
+ <ChartBlockBase>{content}</ChartBlockBase>
257
261
  </ErrorBoundary>
258
262
  );
259
263
  }
@@ -12,7 +12,7 @@ const useLocalforageState = <T = any,>(
12
12
 
13
13
  useEffect(() => {
14
14
  localforage.getItem(key).then((v) => {
15
- if (v !== undefined) {
15
+ if (v !== undefined && v !== null) {
16
16
  setValue(v as T);
17
17
  }
18
18
  setReady(true);