fixing it by just using setdata instead of worrying about add document
This commit is contained in:
@@ -106,7 +106,7 @@ struct AddBasicInfoView: View {
|
||||
Button {
|
||||
var updatedUser = self.authSessionStore.user
|
||||
updatedUser?.avatar = Avatars.avatarSystemNames[self.selectedAvatarIndex]
|
||||
updatedUser?.nickname = self.nickname
|
||||
updatedUser?.nickname = self.nickname
|
||||
|
||||
print("attempting to save information \(updatedUser)")
|
||||
|
||||
@@ -114,7 +114,7 @@ struct AddBasicInfoView: View {
|
||||
self.addInfoViewModel.updateUser(currUser: updatedUser!) {
|
||||
self.navigationStack.push(InnerCircleView())
|
||||
}
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Text("Save")
|
||||
.fontWeight(.heavy)
|
||||
|
||||
@@ -27,11 +27,13 @@ final class PhoneVerificationViewModel : ObservableObject {
|
||||
self.firestoreService.getUser(userId: userId) {[weak self] resultingUser in
|
||||
print("user that was received from get: \(resultingUser?.id)")
|
||||
|
||||
if resultingUser == nil {// if empty, create user - 1 result set cost..prolly higher cost
|
||||
print("creating new user with id: \(userId)")
|
||||
if resultingUser == nil {// if empty, create user
|
||||
let newUser = User(id: userId, phoneNumber: phoneNumber)
|
||||
print("verify the id stayed the same: \(newUser.id)")
|
||||
|
||||
print("creating new user with this object: \(newUser)")
|
||||
|
||||
self?.firestoreService.createUser(user: newUser) { res in
|
||||
print(res)
|
||||
completion(res)
|
||||
}
|
||||
} else { // if not, change last logged in value
|
||||
|
||||
Reference in New Issue
Block a user