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
bb54d5a2
Commit
bb54d5a2
authored
Aug 12, 2024
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 解决当records为空时的报错问题
parent
e6941309
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletions
+3
-1
src/pages/Chat/components/ChatContent/index.tsx
+1
-1
src/store/chatSlice.ts
+2
-0
No files found.
src/pages/Chat/components/ChatContent/index.tsx
View file @
bb54d5a2
...
...
@@ -49,7 +49,7 @@ export const ChatContent: React.FC = () => {
itemContent=
{
(
index
,
record
)
=>
(
<
ChatItem
record=
{
record
}
key=
{
record
.
originalData
?.
groupId
}
/>
)
}
initialTopMostItemIndex=
{
record
s
.
length
-
1
}
// 初始滚动到底部
initialTopMostItemIndex=
{
allItem
s
.
length
-
1
}
// 初始滚动到底部
followOutput=
"smooth"
// 新消息时平滑滚动到底部
/>
</
motion
.
div
>
...
...
src/store/chatSlice.ts
View file @
bb54d5a2
...
...
@@ -10,6 +10,8 @@ const initialState: ChatState = {
function
processApiResponse
(
data
:
OriginalRecord
[]):
ChatRecord
[]
{
const
chatRecord
:
ChatRecord
[]
=
[]
if
(
data
.
length
===
0
)
return
chatRecord
data
.
forEach
((
record
)
=>
{
chatRecord
.
push
({
type
:
'question'
,
...
...
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