Skip to content

Commit

Permalink
😖 Fix completion issues
Browse files Browse the repository at this point in the history
  • Loading branch information
benlmyers committed Jun 23, 2022
1 parent 0d9f57e commit 6dc7c1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/EasyFirebase/Services/Auth/EasyUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public extension EasyUser {
- parameter completion: The completion handler.
*/
func updatePhoto<T>(with url: URL, ofUserType type: T.Type, completion: @escaping (Error?) -> Void = { _ in }) where T: EasyUser {
guard assertAuthMatches() else { completion(); return }
guard assertAuthMatches() else { completion(nil); return }
if let authUser = authUser {
let changeRequest = authUser.createProfileChangeRequest()
changeRequest.photoURL = url
Expand All @@ -325,9 +325,9 @@ public extension EasyUser {
- parameter completion: The completion handler.
*/
func updatePhoto<T>(with data: Data, ofUserType type: T.Type, progress: @escaping (Double) -> Void = { _ in }, completion: @escaping (Error?) -> Void = { _ in }) where T: EasyUser {
guard assertAuthMatches() else { completion(); return }
guard assertAuthMatches() else { completion(nil); return }
EasyStorage.put(data, to: StorageResource(id: id, folder: "Profile Images"), progress: progress) { [self] url in
guard let url = url else { completion(); return }
guard let url = url else { completion(nil); return }
updatePhoto(with: url, ofUserType: type, completion: completion)
}
}
Expand All @@ -339,7 +339,7 @@ public extension EasyUser {
- parameter completion: The completion handler.
*/
func updatePassword(to newPassword: String, completion: @escaping (Error?) -> Void = { _ in }) {
guard assertAuthMatches() else { completion(); return }
guard assertAuthMatches() else { completion(nil); return }
if let authUser = authUser {
authUser.updatePassword(to: newPassword, completion: completion)
}
Expand Down

0 comments on commit 6dc7c1f

Please sign in to comment.