From c955fac5854a7cdbd5898fb8658a7c362f51fc81 Mon Sep 17 00:00:00 2001 From: Rizky Date: Wed, 6 Nov 2024 14:48:21 +0700 Subject: [PATCH] checkpoint --- app/web/src/base/load/db/db-proxy.tsx | 2 ++ app/web/src/utils/sync/ws-client.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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, };