mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-25 10:33:21 +03:00
fix: disable deleting series if there is only 1
This commit is contained in:
parent
e5fbb18883
commit
7858230812
@ -103,6 +103,7 @@
|
||||
bind:contextMenuEl={contextMenu}
|
||||
target={meatballButtonEl}
|
||||
headName={name}
|
||||
seriesCount={branch.series?.length ?? 0}
|
||||
{addDescription}
|
||||
/>
|
||||
</div>
|
||||
|
@ -13,10 +13,17 @@
|
||||
contextMenuEl?: ReturnType<typeof ContextMenu>;
|
||||
target?: HTMLElement;
|
||||
headName: string;
|
||||
seriesCount: number;
|
||||
addDescription: () => void;
|
||||
}
|
||||
|
||||
let { contextMenuEl = $bindable(), target, headName, addDescription }: Props = $props();
|
||||
let {
|
||||
contextMenuEl = $bindable(),
|
||||
target,
|
||||
seriesCount,
|
||||
headName,
|
||||
addDescription
|
||||
}: Props = $props();
|
||||
|
||||
const branchStore = getContextStore(VirtualBranch);
|
||||
const branchController = getContext(BranchController);
|
||||
@ -48,6 +55,7 @@
|
||||
/>
|
||||
<ContextMenuItem
|
||||
label="Delete"
|
||||
disabled={seriesCount <= 1}
|
||||
on:click={() => {
|
||||
deleteSeriesModal.show(branch);
|
||||
contextMenuEl?.close();
|
||||
|
Loading…
Reference in New Issue
Block a user