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:
parent
544594a7ad
commit
3fb9c8523a
@ -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");
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user