mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-02 02:12:25 +00:00
fix: make the Delete Chat shortcut work whenever a chat is open, not only while its sidebar row is rendered (#30165)
This commit is contained in:
parent
a9541c18ca
commit
bc50026f7b
2 changed files with 13 additions and 14 deletions
|
|
@ -149,6 +149,19 @@
|
|||
</button>
|
||||
</Menu>
|
||||
{/if}
|
||||
|
||||
{#if !$temporaryChatEnabled && ($user?.role === 'admin' || ($user?.permissions?.chat?.delete ?? true))}
|
||||
<button
|
||||
id="delete-chat-button"
|
||||
aria-label={$i18n.t('Delete')}
|
||||
class="hidden"
|
||||
on:click={() => {
|
||||
deleteChatHandler(chat.id);
|
||||
}}
|
||||
>
|
||||
<EllipsisHorizontal className="size-4.5" strokeWidth="1.5" />
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
<div class="pointer-events-none invisible flex max-w-full min-w-0 items-center gap-2">
|
||||
|
|
|
|||
|
|
@ -782,20 +782,6 @@
|
|||
<MoreHorizontalIcon className="size-3.5" strokeWidth="2" />
|
||||
</button>
|
||||
</ChatMenu>
|
||||
|
||||
{#if id === $chatId && ($user?.role === 'admin' || ($user?.permissions?.chat?.delete ?? true))}
|
||||
<!-- Shortcut support using "delete-chat-button" id -->
|
||||
<button
|
||||
id="delete-chat-button"
|
||||
aria-label={$i18n.t('Delete')}
|
||||
class="hidden"
|
||||
on:click={() => {
|
||||
showDeleteConfirm = true;
|
||||
}}
|
||||
>
|
||||
<MoreHorizontalIcon className="size-3.5" strokeWidth="2" />
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue