mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 03:53:08 +00:00
3fbbc39cd6
Dynamic imports won't work very well with modules and we don't really need them, it's just there to save us an import statement. Let's flip this to a static version.
25 lines
496 B
TypeScript
25 lines
496 B
TypeScript
import {store} from "../store";
|
|
import {router} from "../router";
|
|
|
|
export function input(args: string[]): boolean {
|
|
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;
|
|
}
|