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:
G30
2026-08-10 23:24:59 -06:00
committed by GitHub
co-authored by Nameless-Monster-Nerd
parent 5c79ccc9e5
commit b91bb67b55
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -1277,7 +1277,9 @@
canCompact: () => !!history?.currentId && contextCompactionEnabled,
compactDisabled: () => isActive,
canStatus: () => !!history?.currentId,
canFork: () => !!history?.currentId,
canFork: () =>
!!history?.currentId &&
($_user?.role === 'admin' || ($_user?.permissions?.chat?.import ?? true)),
forkDisabled: () => isActive,
contextUsage: () => statusContextUsage,
onCompact: compactHandler,
@@ -1486,7 +1486,7 @@
</Tooltip>
{/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">
<button
aria-label="Fork chat"