aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/common/login/form-caching.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts/common/login/form-caching.ts')
-rw-r--r--src/scripts/common/login/form-caching.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/scripts/common/login/form-caching.ts b/src/scripts/common/login/form-caching.ts
new file mode 100644
index 0000000..bde6442
--- /dev/null
+++ b/src/scripts/common/login/form-caching.ts
@@ -0,0 +1,22 @@
+import { addPostListener, addPostResponder, JQueryAjaxResponse } from "@/shared/intercept-jquery-ajax";
+
+let loginAreaHTML: string | null = null;
+
+addPostResponder(
+ "viewLoginAreaAction",
+ function(_args): JQueryAjaxResponse | undefined | null {
+ return loginAreaHTML
+ ? {
+ data: loginAreaHTML
+ }
+ : null;
+ }
+);
+
+addPostListener(
+ "viewLoginAreaAction",
+ function(_args, result): void {
+ loginAreaHTML = result.data?.toString() ?? "";
+ },
+ false
+);