@lobehub/chat 0.116.3 → 0.116.5

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 0.116.5](https://github.com/lobehub/lobe-chat/compare/v0.116.4...v0.116.5)
6
+
7
+ <sup>Released on **2023-12-27**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix input box losing focus after sending a message on the desktop.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix input box losing focus after sending a message on the desktop, closes [#830](https://github.com/lobehub/lobe-chat/issues/830) ([d491af9](https://github.com/lobehub/lobe-chat/commit/d491af9))
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 0.116.4](https://github.com/lobehub/lobe-chat/compare/v0.116.3...v0.116.4)
31
+
32
+ <sup>Released on **2023-12-26**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Fix ShareModal.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Fix ShareModal ([4592515](https://github.com/lobehub/lobe-chat/commit/4592515))
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 0.116.3](https://github.com/lobehub/lobe-chat/compare/v0.116.2...v0.116.3)
6
56
 
7
57
  <sup>Released on **2023-12-26**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.116.3",
3
+ "version": "0.116.5",
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",
@@ -76,35 +76,39 @@ const ShareModal = memo<ModalProps>(({ onCancel, open }) => {
76
76
  name: 'withSystemRole',
77
77
  valuePropName: 'checked',
78
78
  },
79
- tab === Tab.Screenshot && {
79
+ {
80
80
  children: <Switch />,
81
+ hidden: tab !== Tab.Screenshot,
81
82
  label: t('shareModal.withBackground'),
82
83
  minWidth: undefined,
83
84
  name: 'withBackground',
84
85
  valuePropName: 'checked',
85
86
  },
86
- tab === Tab.Screenshot && {
87
+ {
87
88
  children: <Switch />,
89
+ hidden: tab !== Tab.Screenshot,
88
90
  label: t('shareModal.withFooter'),
89
91
  minWidth: undefined,
90
92
  name: 'withFooter',
91
93
  valuePropName: 'checked',
92
94
  },
93
- tab === Tab.Screenshot && {
95
+ {
94
96
  children: <Segmented options={imageTypeOptions} />,
97
+ hidden: tab !== Tab.Screenshot,
95
98
  label: t('shareModal.imageType'),
96
99
  minWidth: undefined,
97
100
  name: 'imageType',
98
101
  },
99
- tab === Tab.ShareGPT && {
102
+ {
100
103
  children: <Switch />,
104
+ hidden: tab !== Tab.ShareGPT,
101
105
  label: t('shareModal.withPluginInfo'),
102
106
  minWidth: undefined,
103
107
  name: 'withPluginInfo',
104
108
  valuePropName: 'checked',
105
109
  },
106
- ].filter(Boolean) as FormItemProps[],
107
- [],
110
+ ],
111
+ [tab],
108
112
  );
109
113
 
110
114
  return (
@@ -1,6 +1,7 @@
1
1
  import { TextAreaRef } from 'antd/es/input/TextArea';
2
2
  import { useCallback, useRef, useState } from 'react';
3
3
 
4
+ import { useIsMobile } from '@/hooks/useIsMobile';
4
5
  import { useChatStore } from '@/store/chat';
5
6
  import { useGlobalStore } from '@/store/global';
6
7
  import { useSessionStore } from '@/store/session';
@@ -23,12 +24,15 @@ export const useChatInput = () => {
23
24
  s.updateInputMessage,
24
25
  s.stopGenerateMessage,
25
26
  ]);
27
+ const mobile = useIsMobile();
26
28
 
27
29
  const handleSend = useCallback(() => {
28
30
  setExpand(false);
29
- ref?.current?.blur();
31
+ if (mobile) {
32
+ ref?.current?.blur();
33
+ }
30
34
  onSend();
31
- }, [onSend]);
35
+ }, [onSend, mobile]);
32
36
 
33
37
  return {
34
38
  canUpload,