everythings broken and unsmooth
This commit is contained in:
@@ -62,8 +62,6 @@ class FirestoreService {
|
|||||||
completion(nil)
|
completion(nil)
|
||||||
} else {
|
} else {
|
||||||
if !(querySnapshot?.isEmpty)! {
|
if !(querySnapshot?.isEmpty)! {
|
||||||
print("existing user found!!!!: \(querySnapshot?.documents)")
|
|
||||||
|
|
||||||
for document in querySnapshot!.documents {
|
for document in querySnapshot!.documents {
|
||||||
let returnedUser = try? document.data(as: User.self)
|
let returnedUser = try? document.data(as: User.self)
|
||||||
completion(returnedUser)
|
completion(returnedUser)
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ class ContactsViewModel : ObservableObject {
|
|||||||
contactVm.sortingProp = "!" // adding for sorting purposes
|
contactVm.sortingProp = "!" // adding for sorting purposes
|
||||||
contactVm.user = returnedUser
|
contactVm.user = returnedUser
|
||||||
contactVm.isExisting = true
|
contactVm.isExisting = true
|
||||||
|
print("existing user: \(contactVm.cnName)")
|
||||||
}
|
}
|
||||||
|
|
||||||
self?.contacts[contactVm.sortingProp] = contactVm
|
self?.contacts[contactVm.sortingProp] = contactVm
|
||||||
|
|||||||
@@ -97,11 +97,12 @@ struct ListContactRow: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.alert(self.alertText, isPresented: self.$showAlert) {
|
.alert(self.alertText, isPresented: self.$showAlert) {
|
||||||
Button("Add \(contact.cnName)", role: ButtonRole.cancel) {
|
Button("Add \(contact.cnName)") {
|
||||||
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
|
||||||
self.contactsVM.addOrActivateFriendToCircle(userId: self.authSessionStore.user!.id!, friendId: (contact.user!.id)!)
|
self.contactsVM.addOrActivateFriendToCircle(userId: self.authSessionStore.user!.id!, friendId: (contact.user!.id)!)
|
||||||
|
|
||||||
|
self.navigationStack.push(InnerCircleView())
|
||||||
}
|
}
|
||||||
} message: {
|
} message: {
|
||||||
Text(self.alertMessage)
|
Text(self.alertMessage)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ struct InnerCircleView: View {
|
|||||||
@EnvironmentObject var authSessionStore: AuthSessionStore
|
@EnvironmentObject var authSessionStore: AuthSessionStore
|
||||||
@EnvironmentObject var navigationStack: NavigationStack
|
@EnvironmentObject var navigationStack: NavigationStack
|
||||||
|
|
||||||
@State var sheetView: SheetView? = .contacts
|
@State var sheetView: SheetView? = nil
|
||||||
|
|
||||||
let universalSize = UIScreen.main.bounds
|
let universalSize = UIScreen.main.bounds
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user