Skip to content

Commit

Permalink
Fix delete last response hide other responses
Browse files Browse the repository at this point in the history
  • Loading branch information
tanchekwei authored and sunner committed Jul 3, 2023
1 parent 92ff379 commit db56d12
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/Messages/ChatMessages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
<!-- If current message is response, push current message to responses array.
Then check if next message.type === 'prompt', if true, render <chat-responses> -->
<chat-responses
v-if="
!message.hide &&
pushResponseAndCheckIsNextMessagePromptType(index, message)
"
v-if="pushResponseAndCheckIsNextMessagePromptType(index, message)"
:columns="columns"
:responses="responses"
:update-message="updateMessage"
Expand Down Expand Up @@ -106,7 +103,7 @@ function checkIsMessagePromptTypeAndEmptyResponsesIfTrue(message) {
function pushResponseAndCheckIsNextMessagePromptType(index, response) {
const nextIndex = index + 1;
responses.push(response);
if (!response.hide) responses.push(response);
if (nextIndex >= messages.value.length) {
return true; // allow last element
}
Expand Down

1 comment on commit db56d12

@vercel
Copy link

@vercel vercel bot commented on db56d12 Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

chatall – ./

chatall-llm.vercel.app
chatall-git-main-sunner.vercel.app
chatall-sunner.vercel.app

Please sign in to comment.