Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurvihill committed Nov 26, 2019
1 parent a372cff commit e1a01be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ Finds a user previously created with [`createUser`](https://www.firebase.com/doc
##### `updateUser(user)` -> `Promise<Object>`

Replace the existing user with a new one, by matching uid. Throws an
error If no user exists whose uid matches the given user's uid. Returns
the updated user.
error If no user exists whose uid matches the given user's uid. Resolves
with the updated user when complete. This operation is queued until the
next flush.

## Server Timestamps

Expand Down
4 changes: 2 additions & 2 deletions src/firebase-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ FirebaseAuth.prototype.updateUser = function (newUser) {
this._defer('updateUser', _.toArray(arguments), () => {
const i = _.findIndex(self._auth.users, u => u.uid === newUser.uid);
if (i === -1) {
return reject(new Error('Tried to update a nonexistent user'));
reject(new Error('Tried to update a nonexistent user'));
} else {
self._auth.users[i] = newUser.clone();
return resolve(newUser);
resolve(newUser);
}
});
});
Expand Down

0 comments on commit e1a01be

Please sign in to comment.