diff options
Diffstat (limited to 'src/scripts/common/login/form-caching.ts')
| -rw-r--r-- | src/scripts/common/login/form-caching.ts | 22 |
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 +); |
