From 0acf08e8df8af73dab9173f72258e407e12aa064 Mon Sep 17 00:00:00 2001 From: Rizky Date: Wed, 9 Oct 2024 18:00:59 +0700 Subject: [PATCH] checkpoint --- app/web/src/base/load/db/db-proxy.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/web/src/base/load/db/db-proxy.tsx b/app/web/src/base/load/db/db-proxy.tsx index c08ccc52..8ca04235 100644 --- a/app/web/src/base/load/db/db-proxy.tsx +++ b/app/web/src/base/load/db/db-proxy.tsx @@ -201,13 +201,19 @@ export const fetchSendDb = async ( const res = await fetch(getProxyUrl(url), { method: "POST", body }); text = await res.text(); result = JSON.parse(text); - if (["localhost", "prasi.avolut.com"].includes(location.hostname)) { + if ( + typeof location === "object" && + ["localhost", "prasi.avolut.com"].includes(location.hostname) + ) { console.log(`%c⬆`, "color:green", "SENT", params); console.log(`%c⬇`, `color:purple`, "RECV", result); console.log(""); } } catch (e) { - if (["localhost", "prasi.avolut.com"].includes(location.hostname)) { + if ( + typeof location === "object" && + ["localhost", "prasi.avolut.com"].includes(location.hostname) + ) { console.error("Error while fetching from db:"); console.error(`%c⬆`, "color:green", "SENT", params); console.error(`%c⬇`, `color:red`, "RECV", text);