This commit is contained in:
Rizky 2024-08-06 06:57:45 +07:00
parent 706048c882
commit bc151fa2e8
2 changed files with 8 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -21,15 +21,12 @@ const getRoute = () => {
}>(async (done) => { }>(async (done) => {
if (cached.route) done(cached.route); if (cached.route) done(cached.route);
let is_done = false;
const res = await fetch(base.url`_prasi/route`); const res = await fetch(base.url`_prasi/route`);
if (!is_done) {
if (!res.headers.get("content-encoding")) { if (!res.headers.get("content-encoding")) {
fetch(base.url`_prasi/compress/only-gz`); fetch(base.url`_prasi/compress/only-gz`);
} }
cached.route = await res.json(); cached.route = await res.json();
done(cached.route); done(cached.route);
}
}); });
}; };
@ -94,8 +91,9 @@ const injectSiteScript = () => {
const cur = new URL(location.href); const cur = new URL(location.href);
cur.pathname = ""; cur.pathname = "";
if ( if (
!["prasi.avolut.com"].includes(cur.hostname) && !base_url ||
cur.host !== "localhost:4550" (!["prasi.avolut.com"].includes(cur.hostname) &&
cur.host !== "localhost:4550")
) { ) {
const cur_url = cur.toString(); const cur_url = cur.toString();
script.src = `${ script.src = `${