From d797af3c57e16e0050bf02c5701a5f0d930e8f01 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Tue, 26 Jan 2021 20:40:28 -0500 Subject: [PATCH] [O] Warn user that they can't undo deleting account --- ProjectClock/Account.swift | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ProjectClock/Account.swift b/ProjectClock/Account.swift index 21880d5..4237bd5 100644 --- a/ProjectClock/Account.swift +++ b/ProjectClock/Account.swift @@ -216,11 +216,16 @@ class ManageVC: UIViewController */ @IBAction func deleteAccount(_ sender: Any) { - sendReq(APIs.delete, title: "Deleting...") + enterPin("Are you sure?", "Enter 1234 to continue deleting your account, you can't undo this.") { - print("Deleted! \($0)") - self.msg("Deleted!", "You are erased from our database, you no longer exist.") - self.logout(sender) + guard $0 == "1234" else { return } + + self.sendReq(APIs.delete, title: "Deleting...") + { + print("Deleted! \($0)") + self.msg("Deleted!", "You are erased from our database, you no longer exist.") + self.logout(sender) + } } } }