Apply changes to getCommands/search

This commit is contained in:
JeDaYoshi 2021-07-07 22:12:28 +00:00
parent 0d839c501e
commit 162b42d9b0
No known key found for this signature in database
GPG Key ID: 8060B288C274219D
2 changed files with 10 additions and 3 deletions

View File

@ -312,7 +312,7 @@ function completeNicks(word, isFuzzy) {
}
function getCommands() {
const cmds = constants.commands;
const cmds = constants.commands.slice();
if (store.state.settings.searchEnabled === false) {
const search = cmds.indexOf("/search");
@ -326,7 +326,7 @@ function getCommands() {
}
function completeCommands(word) {
const words = getCommands().slice();
const words = getCommands();
return fuzzyGrep(word, words);
}

View File

@ -5,7 +5,14 @@ import {router} from "../router";
function input(args) {
if (!store.state.settings.searchEnabled) {
store.commit("currentUserVisibleError", "Search is currently not enabled.");
const disabled = "Search is currently not enabled.";
store.commit("currentUserVisibleError", disabled);
setTimeout(
() =>
store.state.currentUserVisibleError === disabled &&
store.commit("currentUserVisibleError", null),
5000
);
} else {
router.push({
name: "SearchResults",