mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 20:13:07 +00:00
28 lines
505 B
TypeScript
28 lines
505 B
TypeScript
|
import {store} from "../store";
|
||
|
import {router} from "../router";
|
||
|
|
||
|
function input(args: string[]) {
|
||
|
if (!store.state.settings.searchEnabled) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
router
|
||
|
.push({
|
||
|
name: "SearchResults",
|
||
|
params: {
|
||
|
id: store.state.activeChannel?.channel.id,
|
||
|
},
|
||
|
query: {
|
||
|
q: args.join(" "),
|
||
|
},
|
||
|
})
|
||
|
.catch((e: Error) => {
|
||
|
// eslint-disable-next-line no-console
|
||
|
console.error(`Failed to push SearchResults route: ${e.message}`);
|
||
|
});
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
export default {input};
|