fix: hide chat fork actions when chat import permission is disabled (#27711)

Co-authored-by: Nameless-Monster-Nerd <Nameless-Monster-Nerd@users.noreply.github.com>
This commit is contained in:
G30andNameless-Monster-Nerd authored and GitHub committed 2026-08-10 23:24:59 -06:00
1 parent 5c79ccc9e5
commit b91bb67b55
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -1277,7 +1277,9 @@
canCompact: () => !!history?.currentId && contextCompactionEnabled, canCompact: () => !!history?.currentId && contextCompactionEnabled,
compactDisabled: () => isActive, compactDisabled: () => isActive,
canStatus: () => !!history?.currentId, canStatus: () => !!history?.currentId,
canFork: () => !!history?.currentId, canFork: () =>
!!history?.currentId &&
($_user?.role === 'admin' || ($_user?.permissions?.chat?.import ?? true)),
forkDisabled: () => isActive, forkDisabled: () => isActive,
contextUsage: () => statusContextUsage, contextUsage: () => statusContextUsage,
onCompact: compactHandler, onCompact: compactHandler,
@@ -1486,7 +1486,7 @@
</Tooltip> </Tooltip>
{/each} {/each}
{#if message.done && !readOnly && forkHandler} {#if message.done && !readOnly && forkHandler && ($user?.role === 'admin' || ($user?.permissions?.chat?.import ?? true))}
<Tooltip content="Fork chat" placement="bottom"> <Tooltip content="Fork chat" placement="bottom">
<button <button
aria-label="Fork chat" aria-label="Fork chat"