Skip to content

Commit 02d0df2

Browse files
committed
Split off is not ready
1 parent f007eb6 commit 02d0df2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

apps/desktop/src/components/v3/FileContextMenu.svelte

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@
1313
import { SETTINGS, type Settings } from '$lib/settings/userSettings';
1414
import { StackService } from '$lib/stacks/stackService.svelte';
1515
import { UiState } from '$lib/state/uiState.svelte';
16+
import { User } from '$lib/user/user';
1617
import { computeChangeStatus } from '$lib/utils/fileStatus';
1718
import { getEditorUri, openExternalUrl } from '$lib/utils/url';
18-
import { getContext, getContextStoreBySymbol, inject } from '@gitbutler/shared/context';
19+
import {
20+
getContext,
21+
getContextStore,
22+
getContextStoreBySymbol,
23+
inject
24+
} from '@gitbutler/shared/context';
1925
import AsyncButton from '@gitbutler/ui/AsyncButton.svelte';
2026
import Button from '@gitbutler/ui/Button.svelte';
2127
import ContextMenu from '@gitbutler/ui/ContextMenu.svelte';
@@ -70,6 +76,8 @@
7076
const userSettings = getContextStoreBySymbol<Settings, Writable<Settings>>(SETTINGS);
7177
const isUncommitted = $derived(selectionId.type === 'worktree');
7278
const isBranchFiles = $derived(selectionId.type === 'branch');
79+
const user = getContextStore(User);
80+
const isAdmin = $derived($user.role === 'admin');
7381
7482
let confirmationModal: ReturnType<typeof Modal> | undefined;
7583
let stashConfirmationModal: ReturnType<typeof Modal> | undefined;
@@ -361,7 +369,7 @@
361369
}
362370
}}
363371
/>
364-
{#if isBranchFiles}
372+
{#if isBranchFiles && isAdmin}
365373
<ContextMenuItem
366374
label="Split off changes"
367375
onclick={async () => {

0 commit comments

Comments
 (0)