mirror of
https://github.com/open-webui/open-webui
synced 2025-04-10 15:45:45 +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));
|
||||
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) {
|
||||
_messageId = messageChildrenIds.at(-1);
|
||||
|
@ -347,7 +347,7 @@
|
||||
</button>
|
||||
</Tooltip>
|
||||
|
||||
{#if !isFirstMessage && !readOnly}
|
||||
{#if !readOnly && siblings.length > 1}
|
||||
<Tooltip content={$i18n.t('Delete')} placement="bottom">
|
||||
<button
|
||||
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