ensure that selectedOwnership is correctly removing unselected files

This commit is contained in:
mental 2024-06-21 17:22:04 +01:00
parent bef7a431a2
commit fdc82bbeb8

View File

@ -32,8 +32,17 @@
let draggableElt: HTMLDivElement;
let lastCheckboxDetail = true;
$: if (!lastCheckboxDetail) {
selectedOwnership?.update((ownership) => {
file.hunks.forEach((h) => ownership.remove(file.id, h.id));
return ownership;
});
}
$: if (file && $selectedOwnership) {
checked = file.hunks.every((hunk) => $selectedOwnership?.contains(file.id, hunk.id)) && lastCheckboxDetail;
checked =
file.hunks.every((hunk) => $selectedOwnership?.contains(file.id, hunk.id)) &&
lastCheckboxDetail;
}
$: if ($fileIdSelection && draggableElt)