2021-05-06 01:22:09 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
import store from "../store";
|
|
|
|
import {router} from "../router";
|
|
|
|
|
|
|
|
function input(args) {
|
2021-07-03 22:53:45 +00:00
|
|
|
if (!store.state.settings.searchEnabled) {
|
2021-07-07 22:12:28 +00:00
|
|
|
const disabled = "Search is currently not enabled.";
|
|
|
|
store.commit("currentUserVisibleError", disabled);
|
|
|
|
setTimeout(
|
|
|
|
() =>
|
|
|
|
store.state.currentUserVisibleError === disabled &&
|
|
|
|
store.commit("currentUserVisibleError", null),
|
|
|
|
5000
|
|
|
|
);
|
2021-07-03 22:53:45 +00:00
|
|
|
} else {
|
|
|
|
router.push({
|
|
|
|
name: "SearchResults",
|
|
|
|
params: {
|
|
|
|
id: store.state.activeChannel.channel.id,
|
|
|
|
},
|
|
|
|
query: {
|
|
|
|
q: args.join(" "),
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
2021-05-06 01:22:09 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {input};
|