mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 23:12:04 +00:00
fix(account): stop calling a delete with a grace window permanent
With the deletion grace window on, the confirm dialog still asked to delete the account permanently and its button said so, while the body promised fourteen days and an admin undo. The title and the button now match the window, and the success message that names the erase date stays long enough to read before the sign-in page.
This commit is contained in:
1 parent
789beff176
commit
c4b300ad78
10 files changed
+36
-5
No files matched your search
@@ -267,9 +267,14 @@ function AccountDeleteCard() {
|
||||
// deleted the row); give the toast a beat to paint, then bounce to the
|
||||
// login page. Leave `deleting` set so the confirm button keeps its
|
||||
// pending state through the redirect: only an admin can undo it now.
|
||||
setTimeout(() => {
|
||||
loadDocument("/auth/login");
|
||||
}, 1_500);
|
||||
// With a grace window the message names the erase date, so it stays
|
||||
// long enough to read.
|
||||
setTimeout(
|
||||
() => {
|
||||
loadDocument("/auth/login");
|
||||
},
|
||||
typeof scheduledPurgeAt === "string" ? 5_000 : 1_500,
|
||||
);
|
||||
} catch (err) {
|
||||
setDeleting(false);
|
||||
const message = recentProofErrorMessage(
|
||||
@@ -330,7 +335,11 @@ function AccountDeleteCard() {
|
||||
if (deleting) return;
|
||||
setConfirmOpen(open);
|
||||
}}
|
||||
title={t("settings.deleteAccountConfirmTitle")}
|
||||
title={
|
||||
graceDays > 0
|
||||
? t("settings.deleteAccountConfirmTitleGrace")
|
||||
: t("settings.deleteAccountConfirmTitle")
|
||||
}
|
||||
body={
|
||||
graceDays > 0
|
||||
? t("settings.deleteAccountConfirmDescriptionGrace", {
|
||||
@@ -338,7 +347,11 @@ function AccountDeleteCard() {
|
||||
})
|
||||
: t("settings.deleteAccountConfirmDescription")
|
||||
}
|
||||
confirmLabel={t("settings.deleteAccountFinal")}
|
||||
confirmLabel={
|
||||
graceDays > 0
|
||||
? t("settings.deleteAccountFinalGrace")
|
||||
: t("settings.deleteAccountFinal")
|
||||
}
|
||||
onConfirm={() => void handleDeleteAccount()}
|
||||
pending={deleting}
|
||||
slot="settings-account-delete"
|
||||
|
||||
Reference in new issue
Block a user