aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/main.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/frontend/main.ts b/frontend/main.ts
index a5c18e7..85de64e 100644
--- a/frontend/main.ts
+++ b/frontend/main.ts
@@ -2,12 +2,10 @@
import { bangs, load_bangs, process_query } from "./query.ts";
import { add_page_content, status } from "./ui.ts"
+load_bangs()
globalThis.addEventListener("hashchange", () => process_url())
-globalThis.addEventListener("load", () => {
- load_bangs() // not awaiting so we can continue loading
- process_url()
-})
+globalThis.addEventListener("load", () => process_url())
function process_url() {
if (document.location.hash.length != 0) {
@@ -21,7 +19,7 @@ function process_url() {
}
bangs.then(bangs => {
console.log("bop");
-
+
if (!bangs[engine]) {
status("error", "Engine does not exist")
window.location.hash = "#"