diff --git a/frontend/src/lib/components/view/batch-operations-toolbar.svelte b/frontend/src/lib/components/view/batch-operations-toolbar.svelte index 4b2438b..b74760e 100644 --- a/frontend/src/lib/components/view/batch-operations-toolbar.svelte +++ b/frontend/src/lib/components/view/batch-operations-toolbar.svelte @@ -242,7 +242,16 @@ 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; diff --git a/frontend/src/routes/(root)/settings/libraries/[libraryId]/duplicates/+page.svelte b/frontend/src/routes/(root)/settings/libraries/[libraryId]/duplicates/+page.svelte index 4ca82e2..7e0f2b7 100644 --- a/frontend/src/routes/(root)/settings/libraries/[libraryId]/duplicates/+page.svelte +++ b/frontend/src/routes/(root)/settings/libraries/[libraryId]/duplicates/+page.svelte @@ -190,7 +190,16 @@ 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)} /> {/key}