mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-20 16:11: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 filePath: string;
|
||||||
export let projectPath: string | undefined;
|
export let projectPath: string | undefined;
|
||||||
|
export let readonly: boolean;
|
||||||
|
|
||||||
const branchController = getContext(BranchController);
|
const branchController = getContext(BranchController);
|
||||||
|
|
||||||
@ -22,7 +23,7 @@
|
|||||||
<PopupMenu bind:this={popupMenu} let:item let:dismiss>
|
<PopupMenu bind:this={popupMenu} let:item let:dismiss>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<ContextMenuSection>
|
<ContextMenuSection>
|
||||||
{#if item.hunk !== undefined}
|
{#if item.hunk !== undefined && !readonly}
|
||||||
<ContextMenuItem
|
<ContextMenuItem
|
||||||
label="Discard"
|
label="Discard"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
if (popupMenu) popupMenu.$destroy();
|
if (popupMenu) popupMenu.$destroy();
|
||||||
return new HunkContextMenu({
|
return new HunkContextMenu({
|
||||||
target: document.body,
|
target: document.body,
|
||||||
props: { projectPath: project.vscodePath, filePath }
|
props: { projectPath: project.vscodePath, filePath, readonly }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user