Skip to content

Commit

Permalink
Remove useUser's initialData override (#539)
Browse files Browse the repository at this point in the history
* remove auth optimization

* regenerate docs

* bump version
  • Loading branch information
jhuleatt authored Aug 19, 2022
1 parent 414201e commit 9754f86
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 29 deletions.
10 changes: 5 additions & 5 deletions docs/reference/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/reference/interfaces/AuthCheckProps.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/reference/interfaces/ClaimsCheckProps.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/interfaces/ClaimsValidator.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/interfaces/SignInCheckOptionsBasic.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/reference/interfaces/SignInCheckOptionsClaimsObject.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.2.2",
"version": "4.2.3",
"license": "MIT",
"type": "module",
"main": "dist/index.umd.cjs",
Expand Down
9 changes: 1 addition & 8 deletions src/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,8 @@ export function useUser<T = unknown>(options?: ReactFireOptions<T>): ObservableS

const observableId = `auth:user:${auth.name}`;
const observable$ = user(auth);
const _options: ReactFireOptions<T> = { ...options } ?? {};

// only set/override initialData if auth has finished loading
if (auth.currentUser !== undefined) {
_options.initialData = auth.currentUser;
_options.startWithValue = auth.currentUser;
}

return useObservable(observableId, observable$, _options);
return useObservable(observableId, observable$, options);
}

export function useIdTokenResult(user: User, forceRefresh: boolean = false, options?: ReactFireOptions<IdTokenResult>): ObservableStatus<IdTokenResult> {
Expand Down

0 comments on commit 9754f86

Please sign in to comment.