Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
172d8756
Commit
172d8756
authored
Jan 09, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:历史记录切换时调用常见问题时机
parent
186aef40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
src/layouts/HistoryBar/components/HistoryBarList/index.tsx
+2
-1
src/pages/Home/HomeNew.tsx
+11
-2
No files found.
src/layouts/HistoryBar/components/HistoryBarList/index.tsx
View file @
172d8756
...
@@ -26,7 +26,7 @@ export const HistoryBarList: React.FC<HistoryBarListProps> = ({ searchValue, onS
...
@@ -26,7 +26,7 @@ export const HistoryBarList: React.FC<HistoryBarListProps> = ({ searchValue, onS
if
(
isMobile
())
{
if
(
isMobile
())
{
onSetHistoryVisible
(
false
)
onSetHistoryVisible
(
false
)
}
}
// eslint-disable-next-line no-console
console
.
log
(
'88888888888:'
,
conversation
,
{
console
.
log
(
'88888888888:'
,
conversation
,
{
conversationId
:
conversation
.
conversationId
,
conversationId
:
conversation
.
conversationId
,
toolId
:
conversation
.
toolId
,
toolId
:
conversation
.
toolId
,
...
@@ -58,6 +58,7 @@ export const HistoryBarList: React.FC<HistoryBarListProps> = ({ searchValue, onS
...
@@ -58,6 +58,7 @@ export const HistoryBarList: React.FC<HistoryBarListProps> = ({ searchValue, onS
toolId
:
conversation
.
toolId
||
''
,
toolId
:
conversation
.
toolId
||
''
,
toolName
:
''
,
toolName
:
''
,
shouldChangeStyle
:
true
,
shouldChangeStyle
:
true
,
conversationId
:
conversation
.
conversationId
,
},
},
}))
}))
}
}
...
...
src/pages/Home/HomeNew.tsx
View file @
172d8756
...
@@ -256,8 +256,17 @@ export const Home: React.FC = () => {
...
@@ -256,8 +256,17 @@ export const Home: React.FC = () => {
dispatch
(
clearCurrentToolId
())
dispatch
(
clearCurrentToolId
())
}
}
// 传递 conversationId 给 _handleToolClick
// 如果事件传递了 conversationId,延迟调用以确保路由更新完成
_handleToolClick
(
isToolBtn
,
toolId
,
false
,
conversationId
)
// 延迟一小段时间(100ms)确保 React Router 已完成路由更新和状态同步
if
(
conversationId
)
{
setTimeout
(()
=>
{
_handleToolClick
(
isToolBtn
,
toolId
,
false
,
conversationId
)
},
100
)
}
else
{
// 如果没有传递 conversationId,立即调用(保持原有逻辑)
_handleToolClick
(
isToolBtn
,
toolId
,
false
,
conversationId
)
}
}
}
window
.
addEventListener
(
'toolButtonClick'
,
handleToolClickEvent
as
EventListener
)
window
.
addEventListener
(
'toolButtonClick'
,
handleToolClickEvent
as
EventListener
)
return
()
=>
{
return
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment