We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa9a608 commit 1ff0652Copy full SHA for 1ff0652
OCKSample/Main/Profile/ProfileViewModel.swift
@@ -69,8 +69,13 @@ class ProfileViewModel: ObservableObject {
69
}
70
71
if patientHasBeenUpdated {
72
- _ = try await AppDelegateKey.defaultValue?.store.updatePatient(patientToUpdate)
73
- Logger.profile.info("Successfully updated patient")
+ if let anyPatient = try await AppDelegateKey.defaultValue?.store.updateAnyPatient(patientToUpdate),
+ let updatedPatient = anyPatient as? OCKPatient {
74
+ self.patient = updatedPatient
75
+ Logger.profile.info("Successfully updated patient and synced local state.")
76
+ } else {
77
+ Logger.profile.error("Patient was updated in store but could not be cast to OCKPatient.")
78
+ }
79
80
81
0 commit comments