mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-05 07:42:28 +08:00
fix: handle edge cases in chat panel and message display
- Handle undefined edit.search/edit.replace in EditDiffDisplay - Handle empty chartXML when displaying diagrams - Add missing access code header to regenerate and edit message handlers
This commit is contained in:
@@ -347,6 +347,7 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
|
||||
})
|
||||
|
||||
// Now send the message after state is guaranteed to be updated
|
||||
const accessCode = localStorage.getItem(STORAGE_ACCESS_CODE_KEY) || ""
|
||||
sendMessage(
|
||||
{ parts: userParts },
|
||||
{
|
||||
@@ -354,6 +355,9 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
|
||||
xml: savedXml,
|
||||
sessionId,
|
||||
},
|
||||
headers: {
|
||||
"x-access-code": accessCode,
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -404,6 +408,7 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
|
||||
})
|
||||
|
||||
// Now send the edited message after state is guaranteed to be updated
|
||||
const accessCode = localStorage.getItem(STORAGE_ACCESS_CODE_KEY) || ""
|
||||
sendMessage(
|
||||
{ parts: newParts },
|
||||
{
|
||||
@@ -411,6 +416,9 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
|
||||
xml: savedXml,
|
||||
sessionId,
|
||||
},
|
||||
headers: {
|
||||
"x-access-code": accessCode,
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user