mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-02 02:12:25 +00:00
fix: clear a reply's score and reason when its rating switches thumbs (#30075)
This commit is contained in:
parent
57063aaad8
commit
a63ddb36d2
1 changed files with 14 additions and 9 deletions
|
|
@ -464,6 +464,9 @@
|
|||
annotation: {
|
||||
...(message?.annotation ?? {}),
|
||||
...(rating !== null ? { rating: rating } : {}),
|
||||
...(rating !== null && rating !== message?.annotation?.rating
|
||||
? { reason: null, details: null }
|
||||
: {}),
|
||||
...(details ? details : {})
|
||||
}
|
||||
};
|
||||
|
|
@ -1610,15 +1613,17 @@
|
|||
</div>
|
||||
|
||||
{#if message.done && showRateComment}
|
||||
<RateComment
|
||||
bind:message
|
||||
bind:show={showRateComment}
|
||||
on:save={async (e) => {
|
||||
await feedbackHandler(null, {
|
||||
...e.detail
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{#key message?.annotation?.rating}
|
||||
<RateComment
|
||||
bind:message
|
||||
bind:show={showRateComment}
|
||||
on:save={async (e) => {
|
||||
await feedbackHandler(null, {
|
||||
...e.detail
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/key}
|
||||
{/if}
|
||||
|
||||
{#if (isLastMessage || ($settings?.keepFollowUpPrompts ?? false)) && message.done && !readOnly && (message?.followUps ?? []).length > 0}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue