File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
apps/desktop/src/components/v3 Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 13
13
import { SETTINGS , type Settings } from ' $lib/settings/userSettings' ;
14
14
import { StackService } from ' $lib/stacks/stackService.svelte' ;
15
15
import { UiState } from ' $lib/state/uiState.svelte' ;
16
+ import { User } from ' $lib/user/user' ;
16
17
import { computeChangeStatus } from ' $lib/utils/fileStatus' ;
17
18
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' ;
19
25
import AsyncButton from ' @gitbutler/ui/AsyncButton.svelte' ;
20
26
import Button from ' @gitbutler/ui/Button.svelte' ;
21
27
import ContextMenu from ' @gitbutler/ui/ContextMenu.svelte' ;
70
76
const userSettings = getContextStoreBySymbol <Settings , Writable <Settings >>(SETTINGS );
71
77
const isUncommitted = $derived (selectionId .type === ' worktree' );
72
78
const isBranchFiles = $derived (selectionId .type === ' branch' );
79
+ const user = getContextStore (User );
80
+ const isAdmin = $derived ($user .role === ' admin' );
73
81
74
82
let confirmationModal: ReturnType <typeof Modal > | undefined ;
75
83
let stashConfirmationModal: ReturnType <typeof Modal > | undefined ;
361
369
}
362
370
}}
363
371
/>
364
- {#if isBranchFiles }
372
+ {#if isBranchFiles && isAdmin }
365
373
<ContextMenuItem
366
374
label =" Split off changes"
367
375
onclick ={async () => {
You can’t perform that action at this time.
0 commit comments