diff options
Diffstat (limited to 'frontend/search.ts')
-rw-r--r-- | frontend/search.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/frontend/search.ts b/frontend/search.ts index 0c808db..374cccf 100644 --- a/frontend/search.ts +++ b/frontend/search.ts @@ -1,5 +1,6 @@ import { e } from "./helper.ts"; import { bangs, process_query } from "./query.ts"; +import { status } from "./ui.ts" export function section_info_search() { return e("section", { class: "info" }, @@ -11,6 +12,13 @@ export function section_info_search() { export function section_search(engine: string) { link_engine(engine) + bangs.then(bangs => { + if (!bangs[engine.toLowerCase()]) { + status("error", "Engine does not exist") + window.location.hash = "#" + } + }) + const heading = document.createElement("h1") heading.textContent = engine bangs.then(bangs => heading.textContent = bangs[engine]?.name ?? engine) |