Create a message for search disabled error

This commit is contained in:
JeDaYoshi 2021-07-07 23:00:44 +00:00
parent 162b42d9b0
commit 0a6c33af57
No known key found for this signature in database
GPG key ID: 8060B288C274219D

View file

@ -2,22 +2,22 @@
import store from "../store";
import {router} from "../router";
const Msg = require("../../../src/models/msg");
function input(args) {
const {channel} = store.state.activeChannel;
if (!store.state.settings.searchEnabled) {
const disabled = "Search is currently not enabled.";
store.commit("currentUserVisibleError", disabled);
setTimeout(
() =>
store.state.currentUserVisibleError === disabled &&
store.commit("currentUserVisibleError", null),
5000
);
const message = new Msg({
type: Msg.Type.ERROR,
text: "Search is currently not enabled.",
});
channel.messages.push(message);
} else {
router.push({
name: "SearchResults",
params: {
id: store.state.activeChannel.channel.id,
id: channel.id,
},
query: {
q: args.join(" "),