Skip to content

Commit

Permalink
fix fout (ish) & emptiness problems
Browse files Browse the repository at this point in the history
  • Loading branch information
mi2ebi committed Dec 19, 2024
1 parent e101cfc commit 8ef01f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions events.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ function navigate(q, push_state = true, is_search = false) {
clearRes();
if (!is_search) $`search`.value = q;

if (q == '') {
page = 0;
return
}

let newLink = window.location.href.split("?")[0] + (q ? "?q=" + encodeURIComponent(q) : '')
if (push_state) {
window.history.pushState('', '', newLink)
} else {
window.history.replaceState('', '', newLink)
}


if (q == '') {
page = 0;
return
}

$`bottom`.innerHTML = "chum lao jí pó jóaıse"
worker.postMessage({ q })
}
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<title>mí soakue</title>
<link href="fonts/NotoSans-Regular.ttf" rel="preload" as="font" crossorigin />
<link href="noto.css" rel="stylesheet" />
<link href="iosevka.css" rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
Expand Down Expand Up @@ -83,7 +84,7 @@ <h2>things you can't do here</h2>
});
function updateFromQuery() {
var par = new URLSearchParams(window.location.search);
navigate(par.get("q"), false);
navigate(par.get("q") ?? "", false);
$`search`.focus();
}
window.addEventListener("DOMContentLoaded", updateFromQuery);
Expand Down

0 comments on commit 8ef01f8

Please sign in to comment.