diff --git a/app/web/src/base/load/db/db-proxy.tsx b/app/web/src/base/load/db/db-proxy.tsx index bc019352..df93a027 100644 --- a/app/web/src/base/load/db/db-proxy.tsx +++ b/app/web/src/base/load/db/db-proxy.tsx @@ -3,6 +3,7 @@ import pako, { gzip } from "pako"; import { fetchViaProxy, getProxyUrl } from "../proxy"; import { del, get, set } from "idb-keyval"; import { pack } from "msgpackr"; +import { WS_CONFIG } from "../../../utils/sync/ws-client"; const schema_promise = { tables: {} as Record, @@ -202,6 +203,7 @@ export const fetchSendDb = async ( text = await res.text(); result = JSON.parse(text); if ( + WS_CONFIG.debug && typeof location === "object" && (["localhost", "prasi.avolut.com"].includes(location.hostname) || location.hostname.endsWith(".avolut.com")) diff --git a/app/web/src/utils/sync/ws-client.ts b/app/web/src/utils/sync/ws-client.ts index 9f3c5c9c..4b4d568b 100644 --- a/app/web/src/utils/sync/ws-client.ts +++ b/app/web/src/utils/sync/ws-client.ts @@ -16,7 +16,7 @@ import { initIDB } from "./idb"; const packr = new Packr({ structuredClone: true }); /** CONSTANT */ -const WS_CONFIG = { +export const WS_CONFIG = { debug: !!localStorage.getItem("prasi-ws-debug"), reconnectTimeout: 1000, };