|
|
@@ -1366,6 +1366,13 @@ function _Chat() {
|
|
|
const couldStop = ChatControllerPool.hasPending();
|
|
|
const stopAll = () => ChatControllerPool.stopAll();
|
|
|
|
|
|
+ // 切换聊天窗口后清理上传文件信息
|
|
|
+ useEffect(() => {
|
|
|
+ setWebSearch(false);
|
|
|
+ }, [chatStore.currentSession()])
|
|
|
+
|
|
|
+ const [webSearch, setWebSearch] = useState<boolean>(chatStore.web_search);
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.chat} key={session.id}>
|
|
|
{
|
|
|
@@ -1660,16 +1667,25 @@ function _Chat() {
|
|
|
</div>
|
|
|
</Tooltip>
|
|
|
{/*联网搜索按钮*/}
|
|
|
- <div
|
|
|
- style={{
|
|
|
- padding: '0 12px',
|
|
|
- height: 28,
|
|
|
- borderRadius: 18,
|
|
|
- fontSize: 12,
|
|
|
- background: '#f3f4f6',
|
|
|
- display: 'flex',
|
|
|
- justifyContent: 'center',
|
|
|
- alignItems: 'center'
|
|
|
+ <div style={{
|
|
|
+ padding: '0 12px',
|
|
|
+ height: 28,
|
|
|
+ borderRadius: 18,
|
|
|
+ fontSize: 12,
|
|
|
+ display: 'flex',
|
|
|
+ justifyContent: 'center',
|
|
|
+ alignItems: 'center',
|
|
|
+ marginRight: 10,
|
|
|
+ cursor: 'pointer',
|
|
|
+ background: webSearch ? '#dee9fc' : '#f3f4f6',
|
|
|
+ color: webSearch ? '#3875f6' : '#000000',
|
|
|
+ border: `1px solid ${webSearch ? '#3875f6' : 'transparent'}`,
|
|
|
+ transition: 'all 0.2s ease',
|
|
|
+ userSelect: 'none'
|
|
|
+ }}
|
|
|
+ onClick={() => {
|
|
|
+ setWebSearch(!webSearch);
|
|
|
+ chatStore.setWebSearch(!webSearch);
|
|
|
}}
|
|
|
>
|
|
|
<img
|