[+] Implement leave family

This commit is contained in:
Hykilpikonna
2021-01-24 20:59:54 -05:00
parent 9d4f4c212b
commit 6aed3cf6b4
2 changed files with 19 additions and 1 deletions
+15
View File
@@ -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.")
}
}
}
}
/**
+4 -1
View File
@@ -1086,9 +1086,12 @@
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="De7-dU-p8j">
<rect key="frame" x="0.0" y="40" width="374" height="30"/>
<state key="normal" title="Delete Family">
<state key="normal" title="Leave Family">
<color key="titleColor" systemColor="systemRedColor"/>
</state>
<connections>
<action selector="btnLeave:" destination="4ss-Ye-Da4" eventType="touchUpInside" id="YMe-ri-xkZ"/>
</connections>
</button>
</subviews>
</stackView>