diff --git a/gitbutler-ui/src/lib/components/FileContextMenu.svelte b/gitbutler-ui/src/lib/components/FileContextMenu.svelte index f8b94267b..a8b079a12 100644 --- a/gitbutler-ui/src/lib/components/FileContextMenu.svelte +++ b/gitbutler-ui/src/lib/components/FileContextMenu.svelte @@ -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 @@ {#if item.files !== undefined} - confirmationModal.show(item)} /> + {#if containsBinaryFiles(item)} + + {:else} + confirmationModal.show(item)} /> + {/if} {/if}