mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
cleaner code
This commit is contained in:
parent
d3c655d351
commit
0872b8b044
1 changed files with 12 additions and 13 deletions
|
|
@ -783,21 +783,20 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
)
|
||||
|
||||
const visibleMessages = useMemo(() => {
|
||||
// First, collect all checkpoint hashes that are associated with user_feedback messages
|
||||
const userMessageCheckpointHashes = new Set<string>()
|
||||
modifiedMessages.forEach((message) => {
|
||||
if (message.say === "user_feedback" && message.checkpoint) {
|
||||
const checkpoint = message.checkpoint as any
|
||||
if (checkpoint.type === "user_message" && checkpoint.hash) {
|
||||
userMessageCheckpointHashes.add(checkpoint.hash)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const newVisibleMessages = modifiedMessages.filter((message) => {
|
||||
// Filter out checkpoint_saved messages that are associated with user messages
|
||||
if (message.say === "checkpoint_saved" && message.text && userMessageCheckpointHashes.has(message.text)) {
|
||||
return false
|
||||
if (message.say === "checkpoint_saved" && message.text) {
|
||||
// Check if there's a user_feedback message with a checkpoint that has this hash
|
||||
const hasAssociatedUserMessage = modifiedMessages.some(
|
||||
(msg) =>
|
||||
msg.say === "user_feedback" &&
|
||||
msg.checkpoint &&
|
||||
(msg.checkpoint as any).type === "user_message" &&
|
||||
(msg.checkpoint as any).hash === message.text,
|
||||
)
|
||||
if (hasAssociatedUserMessage) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (everVisibleMessagesTsRef.current.has(message.ts)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue