Enable searching for the same query again

Previously we got an error instead, but in the meantime new messages could have come in. As such we should allow to search again
This commit is contained in:
Nachtalb 2021-04-13 00:45:15 +02:00
parent 544594a7ad
commit 3fb9c8523a
No known key found for this signature in database
GPG key ID: E48DF13C07055D92
2 changed files with 21 additions and 10 deletions

View file

@ -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");
}
});
},
},
};

View file

@ -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() {