fix: reopen the merge dialog after dismissing it

This commit is contained in:
2026-08-17 10:35:24 -04:00
parent d16a90f08f
commit 75fe41e266
2 changed files with 20 additions and 2 deletions
@@ -242,7 +242,16 @@
<MergeBooks
books={mergingBooks}
libraryId={libraryState.activeLibrary!.id}
open={true}
bind:open={
() => mergingBooks !== null,
(value) => {
// Bound, not passed as a bare `true`: the dialog closes itself on an
// outside click or Escape, and if that never reaches `mergingBooks`
// the snapshot stays set — the button then re-assigns the same
// selection, nothing changes, and the dialog never reopens.
if (!value) mergingBooks = null;
}
}
onmerged={(_survivor, folded) => {
// Only the folded records are gone; the survivor is still in the library.
libraryState.activeLibrary!.total! -= folded.length;