mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-20 08:01:46 +03:00
Merge pull request #3776 from gitbutlerapp/hunk-context-menu-read-only
feat: Add readonly prop for HunkContextMenu and HunkViewer
This commit is contained in:
commit
eed84f51b6
@ -9,6 +9,7 @@
|
||||
|
||||
export let filePath: string;
|
||||
export let projectPath: string | undefined;
|
||||
export let readonly: boolean;
|
||||
|
||||
const branchController = getContext(BranchController);
|
||||
|
||||
@ -22,7 +23,7 @@
|
||||
<PopupMenu bind:this={popupMenu} let:item let:dismiss>
|
||||
<ContextMenu>
|
||||
<ContextMenuSection>
|
||||
{#if item.hunk !== undefined}
|
||||
{#if item.hunk !== undefined && !readonly}
|
||||
<ContextMenuItem
|
||||
label="Discard"
|
||||
on:click={() => {
|
||||
|
@ -43,7 +43,7 @@
|
||||
if (popupMenu) popupMenu.$destroy();
|
||||
return new HunkContextMenu({
|
||||
target: document.body,
|
||||
props: { projectPath: project.vscodePath, filePath }
|
||||
props: { projectPath: project.vscodePath, filePath, readonly }
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user