Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ui/src/components/ai-chat/component/answer-content/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
<MdRenderer
v-if="
(chatRecord.write_ed === undefined || chatRecord.write_ed === true) &&
answer_text.length == 0
answer_text.length == 0 &&
answer_text
.map((item) => item.content)
.join('')
.trim().length == 0
"
:source="$t('chat.tip.answerMessage')"
></MdRenderer>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There seems to be a logical error in the conditional check. The additional condition that checks if answer_text has no characters after trimming is redundant because it essentially duplicates the initial check that verifies if answer_text is empty:

(v-if="(
    (chatRecord.write_ed === undefined || chatRecord.write_ed === true) &&
        answer_text.length == 0
)")

Here's a cleaner version of the code without the unnecessary part:

<v-if="
    (chatRecord.write_ed === undefined || chatRecord.write_ed === true) &&
        answer_text.length == 0
">
    <MdRenderer
        :source="$t('chat.tip.answerMessage')"
    />
</v-if>

This removes the repeated check for an entirely empty string, simplifying the logic while maintaining functionality.

Expand Down
Loading