aboutsummaryrefslogtreecommitdiffstats
path: root/apps/kit/src/routes/(public)/reset/+page.svelte
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-09-25 12:01:37 +0200
committerivarlovlie <git@ivarlovlie.no>2022-09-25 12:01:37 +0200
commit2a9e668dceda855f8302e2ca9f81ebd6f0e7b5c1 (patch)
tree13f7a597c2e31210e722388de8aabf0d43ba5326 /apps/kit/src/routes/(public)/reset/+page.svelte
parent9f65b9e65ead6cc6b8ce5cfcf650b49fe134cd91 (diff)
downloadgreatoffice-2a9e668dceda855f8302e2ca9f81ebd6f0e7b5c1.tar.xz
greatoffice-2a9e668dceda855f8302e2ca9f81ebd6f0e7b5c1.zip
feat: Safelist all classes needed for alerts
Diffstat (limited to 'apps/kit/src/routes/(public)/reset/+page.svelte')
-rw-r--r--apps/kit/src/routes/(public)/reset/+page.svelte22
1 files changed, 7 insertions, 15 deletions
diff --git a/apps/kit/src/routes/(public)/reset/+page.svelte b/apps/kit/src/routes/(public)/reset/+page.svelte
index 8568234..5092b4b 100644
--- a/apps/kit/src/routes/(public)/reset/+page.svelte
+++ b/apps/kit/src/routes/(public)/reset/+page.svelte
@@ -18,27 +18,19 @@
title: "",
} as ErrorResult;
- $: showSuccessAlert =
- (successData?.text.length ?? 0 + successData?.title.length ?? 0) > 0;
- const successData = {
- text: "",
- title: "",
- };
-
- const strings = get(LL);
+ let showSuccessAlert = false;
async function submit() {
errorData.text = "";
errorData.title = "";
+ showSuccessAlert = false;
const request = await create_forgot_password_request(formData.email);
if (!request.ok) {
- errorData.text = request.data.text ?? strings.common.tryAgainSoon();
- errorData.title =
- request.data.title ?? strings.common.unexpectedError();
+ errorData.text = request.data.text ?? $LL.common.tryAgainSoon();
+ errorData.title = request.data.title ?? $LL.common.unexpectedError();
return;
}
- successData.title = strings.common.success() + "!";
- successData.text = strings.reset.requestSentMessage();
+ showSuccessAlert = true;
}
</script>
@@ -75,8 +67,8 @@
<Alert
type="success"
- title={successData.title}
- message={successData.text}
+ title={$LL.common.success()}
+ message={$LL.reset.requestSentMessage()}
visible={showSuccessAlert}
/>
<div>