mirror of
https://github.com/open-webui/open-webui
synced 2025-05-20 13:15:13 +00:00
refac: user message delete
This commit is contained in:
parent
4e36b9794f
commit
324cd94c53
@ -212,7 +212,14 @@
|
|||||||
const _chatId = JSON.parse(JSON.stringify($chatId));
|
const _chatId = JSON.parse(JSON.stringify($chatId));
|
||||||
let _messageId = JSON.parse(JSON.stringify(message.id));
|
let _messageId = JSON.parse(JSON.stringify(message.id));
|
||||||
|
|
||||||
let messageChildrenIds = history.messages[_messageId].childrenIds;
|
let messageChildrenIds = [];
|
||||||
|
if (_messageId === null) {
|
||||||
|
messageChildrenIds = Object.keys(history.messages).filter(
|
||||||
|
(id) => history.messages[id].parentId === null
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
messageChildrenIds = history.messages[_messageId].childrenIds;
|
||||||
|
}
|
||||||
|
|
||||||
while (messageChildrenIds.length !== 0) {
|
while (messageChildrenIds.length !== 0) {
|
||||||
_messageId = messageChildrenIds.at(-1);
|
_messageId = messageChildrenIds.at(-1);
|
||||||
|
@ -347,7 +347,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
{#if !isFirstMessage && !readOnly}
|
{#if !readOnly && siblings.length > 1}
|
||||||
<Tooltip content={$i18n.t('Delete')} placement="bottom">
|
<Tooltip content={$i18n.t('Delete')} placement="bottom">
|
||||||
<button
|
<button
|
||||||
class="invisible group-hover:visible p-1 rounded-sm dark:hover:text-white hover:text-black transition"
|
class="invisible group-hover:visible p-1 rounded-sm dark:hover:text-white hover:text-black transition"
|
||||||
|
Loading…
Reference in New Issue
Block a user