Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Part 3] Small copy error #51

Closed
goliatone opened this issue Jan 17, 2021 · 0 comments
Closed

[Part 3] Small copy error #51

goliatone opened this issue Jan 17, 2021 · 0 comments

Comments

@goliatone
Copy link

Looking at one of the snippets in the 3rd blog post:

class AuthenticationService: ObservableObject {
  // ...
  func updateDisplayName(displayName: String) { // (2)
    if let user = Auth.auth().currentUser {
      let changeRequest = user.createProfileChangeRequest() // (3)
      changeRequest.displayName = displayName
      changeRequest.commitChanges { error in // (4)
        if error != nil {
          print("Successfully updated display name for user [\(user.uid)] to [\(displayName)]")
        }
      }
    }
  }
}

I think this is a typo? Should be error == nil:

if error != nil {
          print("Successfully updated display name for user [\(user.uid)] to [\(displayName)]")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants