adding limits but not doing anything like showing alert

This commit is contained in:
talksik
2021-12-25 17:08:49 -08:00
parent ba065cf71d
commit 316be460e9
2 changed files with 16 additions and 12 deletions
@@ -135,6 +135,7 @@ struct ListContactRow: View {
secondaryButton: .default(Text("Confirm")) { secondaryButton: .default(Text("Confirm")) {
print("adding contact to circle") print("adding contact to circle")
// call method in vm to get it done, then navigate to the circle // call method in vm to get it done, then navigate to the circle
if self.authSessionStore.friendsArr.count < 10 {
self.contactsVM.addOrActivateFriendToCircle(userId: self.authSessionStore.user!.id!, friendId: (contact.user!.id)!) {res in self.contactsVM.addOrActivateFriendToCircle(userId: self.authSessionStore.user!.id!, friendId: (contact.user!.id)!) {res in
print(res) print(res)
@@ -148,6 +149,7 @@ struct ListContactRow: View {
self.navigationStack.push(InnerCircleView()) self.navigationStack.push(InnerCircleView())
} }
}
) )
} }
} }
@@ -202,9 +202,11 @@ struct CircleGridView: View {
message: Text(self.alertSubtext), message: Text(self.alertSubtext),
primaryButton: .destructive(Text("Reject"), action: { primaryButton: .destructive(Text("Reject"), action: {
// create user friend but a rejected one // create user friend but a rejected one
if self.authSessionStore.friendsArr.count < 10 {
self.innerCircleVM.activateOrDeactiveInboxUser(activate: false, userId: self.authSessionStore.user!.id!, friendId: inboxUserId) { res in self.innerCircleVM.activateOrDeactiveInboxUser(activate: false, userId: self.authSessionStore.user!.id!, friendId: inboxUserId) { res in
print(res) print(res)
} }
}
}), }),
secondaryButton: .default(Text("Add"), action: { secondaryButton: .default(Text("Add"), action: {
// create user friend // create user friend