diff --git a/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue b/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue index c45db08edd6..0724b5bf3d7 100644 --- a/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue +++ b/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue @@ -303,7 +303,10 @@ export default { const { setSelectedItems } = useCollectionBuilderItemSelection(); const selection = Array.from(this.contentSelection.values()); setSelectedItems(selection); - this.$router.push({ path: `/collection/new_list?advanced=${advanced}` }); + + // vue-router 4 supports a native force push with clean URLs, but we're using a __vkey__ + // bit as a workaround to allow the builder to be invoked consecutively + this.$router.push({ path: `/collection/new_list?advanced=${advanced}` }, { force: true }); }, // Selected content manipulation, hide/show/delete/purge hideSelected() { diff --git a/client/src/entry/analysis/router-push.js b/client/src/entry/analysis/router-push.js index e75f3f6d975..802709b3aac 100644 --- a/client/src/entry/analysis/router-push.js +++ b/client/src/entry/analysis/router-push.js @@ -15,7 +15,16 @@ export function patchRouterPush(VueRouter) { // add key to location to force component refresh const { title, force, preventWindowManager } = options; if (force) { - location = addSearchParams(location, { __vkey__: Date.now() }); + // since location can either be string or object, we need to pass the string url to addSearchParams + if (typeof location === "string") { + location = addSearchParams(location, { __vkey__: Date.now() }); + } else if (typeof location === "object") { + // convert to string version addSearchParams can handle + let url = this.resolve(location).href; + url = addSearchParams(url, { __vkey__: Date.now() }); + // convert back to object version + location = this.resolve(url).route; + } } // verify if confirmation is required if (this.confirmation) {