mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-29 14:25:45 +03:00
Fix bug in hunk context menu
- it wasn't always referring to the right file
This commit is contained in:
parent
ebbc71a0bc
commit
e7990b41ba
@ -39,10 +39,15 @@
|
||||
|
||||
const userSettings = getContext<SettingsStore>(SETTINGS_CONTEXT);
|
||||
|
||||
const popupMenu = new HunkContextMenu({
|
||||
target: document.body,
|
||||
props: { projectPath, file, branchController }
|
||||
});
|
||||
function updateContextMenu(file: File) {
|
||||
if (popupMenu) popupMenu.$destroy();
|
||||
return new HunkContextMenu({
|
||||
target: document.body,
|
||||
props: { projectPath, file, branchController }
|
||||
});
|
||||
}
|
||||
|
||||
$: popupMenu = updateContextMenu(file);
|
||||
|
||||
let sections: (HunkSection | ContentSection)[] = [];
|
||||
|
||||
@ -78,7 +83,9 @@
|
||||
}
|
||||
|
||||
onDestroy(() => {
|
||||
popupMenu.$destroy();
|
||||
if (popupMenu) {
|
||||
popupMenu.$destroy();
|
||||
}
|
||||
});
|
||||
|
||||
function computedAddedRemoved(section: HunkSection | ContentSection): {
|
||||
|
Loading…
Reference in New Issue
Block a user