From fb9ff31a2920e7b0436b68ddb31482cbcf3527b2 Mon Sep 17 00:00:00 2001 From: Rizky Date: Tue, 25 Jun 2024 16:18:06 +0700 Subject: [PATCH] fix --- app/web/src/base/load/db/db-proxy.tsx | 12 +++++++++++- 1 file changed, 11 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 b660acc9..9c1bd665 100644 --- a/app/web/src/base/load/db/db-proxy.tsx +++ b/app/web/src/base/load/db/db-proxy.tsx @@ -183,5 +183,15 @@ export const fetchSendDb = async (params: any, dburl: string) => { } } - return await cached.promise; + if (cached.result) return cached.result; + + let result = await cached.promise; + if (result) { + try { + return JSON.parse(result); + } catch (e) { + console.error("DBQuery failed:" + result); + } + } + return null; };