mirror of
https://github.com/thelounge/thelounge
synced 2024-11-14 00:07:17 +00:00
Create a message for search disabled error
This commit is contained in:
parent
162b42d9b0
commit
0a6c33af57
1 changed files with 9 additions and 9 deletions
|
@ -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(" "),
|
||||
|
|
Loading…
Reference in a new issue