aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-14 09:41:15 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-14 09:41:15 +0530
commit0ba86b6782f38fc92e34459fe27e9c23e973061b (patch)
tree4383d6083ac42650ace942e37c23e00d0f1018ec
parentadd40f245950f46900db3e3e201d9e63e732a427 (diff)
downloadbanglar-bhumi-utils-0ba86b6782f38fc92e34459fe27e9c23e973061b.tar.gz
banglar-bhumi-utils-0ba86b6782f38fc92e34459fe27e9c23e973061b.zip
chore: viewLoginAreaAction caching now responds with entire Ajax reponse
previously we only stored result.data but now we cache the entire result and use the same in the responder
-rw-r--r--src/scripts/common/login/form-caching.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/scripts/common/login/form-caching.ts b/src/scripts/common/login/form-caching.ts
index 508d076..656de6e 100644
--- a/src/scripts/common/login/form-caching.ts
+++ b/src/scripts/common/login/form-caching.ts
@@ -1,7 +1,7 @@
import { addPostListener, addPostResponder, JQueryAjaxResponse } from "@/shared/intercept-jquery-ajax";
/** Caches the login area HTML to avoid re-fetching it on subsequent requests. */
-let loginAreaHTML: string | null = null;
+let loginAreaHTML: JQueryAjaxResponse | null = null;
/**
* Intercepts `viewLoginAreaAction` AJAX requests and serves the cached HTML
@@ -9,12 +9,8 @@ let loginAreaHTML: string | null = null;
*/
addPostResponder(
"viewLoginAreaAction",
- function(_args): JQueryAjaxResponse | undefined | null {
- return loginAreaHTML
- ? {
- data: loginAreaHTML
- }
- : null;
+ function(_args): JQueryAjaxResponse | null {
+ return loginAreaHTML;
}
);
@@ -25,7 +21,8 @@ addPostResponder(
addPostListener(
"viewLoginAreaAction",
function(_args, result): void {
- loginAreaHTML = result.data?.toString() ?? null;
+ if (result.textStatus === "success")
+ loginAreaHTML = result;
},
false
);