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 <MergeBooks
books={mergingBooks} books={mergingBooks}
libraryId={libraryState.activeLibrary!.id} 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) => { onmerged={(_survivor, folded) => {
// Only the folded records are gone; the survivor is still in the library. // Only the folded records are gone; the survivor is still in the library.
libraryState.activeLibrary!.total! -= folded.length; libraryState.activeLibrary!.total! -= folded.length;
@@ -190,7 +190,16 @@
<MergeBooks <MergeBooks
books={recordsFor(merging)} books={recordsFor(merging)}
libraryId={page.params.libraryId!} libraryId={page.params.libraryId!}
open={true} bind:open={
() => merging !== null,
(value) => {
// Bound, not passed as a bare `true`: the dialog closes itself on an
// outside click or Escape, and if that never reaches `merging` the
// group stays set — the button then re-assigns the same group,
// nothing changes, and the workbench never reopens.
if (!value) merging = null;
}
}
onmerged={() => (merging = null)} onmerged={() => (merging = null)}
/> />
{/key} {/key}