Display error when /search is not enabled

Fixes thelounge/thelounge#4273
This commit is contained in:
JeDaYoshi 2021-07-03 22:53:45 +00:00
parent 5e0a12b124
commit 058b3155d0
No known key found for this signature in database
GPG key ID: 8060B288C274219D

View file

@ -4,15 +4,19 @@ import store from "../store";
import {router} from "../router";
function input(args) {
router.push({
name: "SearchResults",
params: {
id: store.state.activeChannel.channel.id,
},
query: {
q: args.join(" "),
},
});
if (!store.state.settings.searchEnabled) {
store.commit("currentUserVisibleError", "Search is currently not enabled.");
} else {
router.push({
name: "SearchResults",
params: {
id: store.state.activeChannel.channel.id,
},
query: {
q: args.join(" "),
},
});
}
return true;
}