Fix: perf being shit

This commit is contained in:
MotorTruck1221 2024-09-29 00:40:30 -06:00
parent dcbde420a4
commit b38dcc09aa
No known key found for this signature in database
GPG key ID: 08F417E2B8B61EA4

View file

@ -59,6 +59,7 @@ const t = useTranslations(lang);
const omnibox = document.getElementById("omnibox") as HTMLDivElement; const omnibox = document.getElementById("omnibox") as HTMLDivElement;
let epoxyClientOptions: any = null; let epoxyClientOptions: any = null;
let epoxyClient: any = null; let epoxyClient: any = null;
await initEpoxy(); //This ONLY runs once
input?.addEventListener("keypress", function (event: any) { input?.addEventListener("keypress", function (event: any) {
if (event.key === "Enter") { if (event.key === "Enter") {
initSw().then(() => { initSw().then(() => {
@ -68,15 +69,12 @@ const t = useTranslations(lang);
} }
}) })
input?.addEventListener("input", async function() { input?.addEventListener("input", async function() {
console.log("EA");
await initEpoxy(); //This ONLY runs once
if (!epoxyClient) { if (!epoxyClient) {
console.debug("Creating epoxy client"); console.debug("Creating epoxy client");
epoxyClientOptions = new EpoxyClientOptions(); epoxyClientOptions = new EpoxyClientOptions();
epoxyClient = new EpoxyClient(wispUrl, epoxyClientOptions); epoxyClient = new EpoxyClient(wispUrl, epoxyClientOptions);
} }
const value = input?.value; const value = input?.value;
console.log(value);
input.classList.remove("rounded-b-2xl"); input.classList.remove("rounded-b-2xl");
omnibox.classList.remove("hidden"); omnibox.classList.remove("hidden");
if (value.length === 0) { if (value.length === 0) {