mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-20 16:11:46 +03:00
chore: disable discard button for binary files for now
This commit is contained in:
parent
7023e43806
commit
f477d8d277
@ -6,11 +6,16 @@
|
||||
import ContextMenuItem from '$lib/components/contextmenu/ContextMenuItem.svelte';
|
||||
import ContextMenuSection from '$lib/components/contextmenu/ContextMenuSection.svelte';
|
||||
import type { BranchController } from '$lib/vbranches/branchController';
|
||||
import type { AnyFile } from '$lib/vbranches/types';
|
||||
|
||||
export let branchController: BranchController;
|
||||
let confirmationModal: Modal;
|
||||
let popupMenu: PopupMenu;
|
||||
|
||||
function containsBinaryFiles(item: any) {
|
||||
return item.files.some((f: AnyFile) => f.binary);
|
||||
}
|
||||
|
||||
export function openByMouse(e: MouseEvent, item: any) {
|
||||
popupMenu.openByMouse(e, item);
|
||||
}
|
||||
@ -20,7 +25,11 @@
|
||||
<ContextMenu>
|
||||
<ContextMenuSection>
|
||||
{#if item.files !== undefined}
|
||||
<ContextMenuItem label="Discard" on:click={() => confirmationModal.show(item)} />
|
||||
{#if containsBinaryFiles(item)}
|
||||
<ContextMenuItem label="Discard (Binary files not yet supported)" disabled />
|
||||
{:else}
|
||||
<ContextMenuItem label="Discard" on:click={() => confirmationModal.show(item)} />
|
||||
{/if}
|
||||
{/if}
|
||||
</ContextMenuSection>
|
||||
</ContextMenu>
|
||||
|
Loading…
Reference in New Issue
Block a user