Skip to content

Commit

Permalink
Fix:Firebase Warning - added get Vechicles after vechile additions (#168
Browse files Browse the repository at this point in the history
)
  • Loading branch information
SarathVSasikala committed Oct 14, 2023
1 parent 30a81c7 commit 3be8ac3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ final class SettingsViewModel {
vehicleToAdd.userID = uid

do {
let firestoreRef = try Firestore
try Firestore
.firestore()
.collection("vehicles")
.addDocument(from: vehicleToAdd)
vehicleToAdd.id = firestoreRef.documentID
vehicles.append(vehicleToAdd)
} catch {
throw error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ struct SettingsView: View {
Task {
do {
try await viewModel.addVehicle(vehicle)
await viewModel.getVehicles()
isShowingAddVehicle = false
} catch {
errorDetails = error
Expand Down

0 comments on commit 3be8ac3

Please sign in to comment.