diff --git a/client/components/MessageSearchForm.vue b/client/components/MessageSearchForm.vue index acba0f6d..2a1115fd 100644 --- a/client/components/MessageSearchForm.vue +++ b/client/components/MessageSearchForm.vue @@ -127,16 +127,23 @@ export default { this.searchOpened = false; - this.$router.push({ - name: "SearchResults", - params: { - uuid: this.network.uuid, - target: this.channel.name, - }, - query: { - q: this.searchInput, - }, - }); + this.$router + .push({ + name: "SearchResults", + params: { + uuid: this.network.uuid, + target: this.channel.name, + }, + query: { + q: this.searchInput, + }, + }) + .catch((err) => { + if (err.name === "NavigationDuplicated") { + // Search for the same query again + this.$root.$emit("re-search"); + } + }); }, }, }; diff --git a/client/components/Windows/SearchResults.vue b/client/components/Windows/SearchResults.vue index f142ec6a..5bf26984 100644 --- a/client/components/Windows/SearchResults.vue +++ b/client/components/Windows/SearchResults.vue @@ -170,6 +170,10 @@ export default { }, mounted() { this.doSearch(); + this.$root.$on("re-search", this.doSearch); // Enable MessageSearchForm to search for the same query again + }, + beforeDestroy() { + this.$root.$off("re-search"); }, methods: { setActiveChannel() {