working now with setting the right id and creating user properly

This commit is contained in:
talksik
2021-12-18 17:37:48 -08:00
parent 71f5aff78c
commit afe8cc4ad9
3 changed files with 5 additions and 4 deletions
@@ -27,8 +27,9 @@ final class PhoneVerificationViewModel : ObservableObject {
print("user that was received from get: \(user?.id)")
if user == nil {// if empty, create user - 1 result set cost..prolly higher cost
let newOrExistingUser = User(id: userId, phoneNumber: phoneNumber)
firestoreService.createUser(user: newOrExistingUser)
print("creating new user with id: \(userId)")
let newUser = User(id: userId, phoneNumber: phoneNumber)
firestoreService.createUser(user: newUser)
} else { // if not, change last logged in value
// assign to nil so that server can fill it in
user!.lastLoggedInTimestamp = nil