default bang in localstorage

This commit is contained in:
Theo Browne 2025-02-14 23:33:45 -08:00
parent 0b569d2b86
commit 3165c3dccb
No known key found for this signature in database
GPG Key ID: BDDADD971F49875D

View File

@ -1,8 +1,6 @@
import { bangs } from "./bang";
import "./global.css";
const defaultBang = bangs.find((b) => b.t === "g");
function noSearchDefaultPageRender() {
const app = document.querySelector<HTMLDivElement>("#app")!;
app.innerHTML = `
@ -46,6 +44,9 @@ function noSearchDefaultPageRender() {
});
}
const LS_DEFAULT_BANG = localStorage.getItem("default-bang") ?? "g";
const defaultBang = bangs.find((b) => b.t === LS_DEFAULT_BANG);
function getBangredirectUrl() {
const url = new URL(window.location.href);
const query = url.searchParams.get("q")?.trim() ?? "";