From 6aed3cf6b4b102a093fcec64a9b0bd5e37083989 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 24 Jan 2021 20:59:54 -0500 Subject: [PATCH] [+] Implement leave family --- ProjectClock/AccountViewController.swift | 15 +++++++++++++++ ProjectClock/Base.lproj/Main.storyboard | 5 ++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ProjectClock/AccountViewController.swift b/ProjectClock/AccountViewController.swift index 2a58b5b..fbcd201 100644 --- a/ProjectClock/AccountViewController.swift +++ b/ProjectClock/AccountViewController.swift @@ -260,6 +260,21 @@ class FamilyVC: UIViewController } } } + + /** + Called when the user clicks the leave family button + */ + @IBAction func btnLeave(_ sender: Any) + { + enterPin() + { + self.sendReq(APIs.familyChangePin, title: "Leaving...", params: ["pin": $0]) { it in + + localStorage.removeObject(forKey: "family") + self.msg("Leave Success!", "You left the family.") + } + } + } } /** diff --git a/ProjectClock/Base.lproj/Main.storyboard b/ProjectClock/Base.lproj/Main.storyboard index 1bd4319..ebd3215 100644 --- a/ProjectClock/Base.lproj/Main.storyboard +++ b/ProjectClock/Base.lproj/Main.storyboard @@ -1086,9 +1086,12 @@