Skip to content

Commit

Permalink
fix(firestore): use new ref/query when changing from/to undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
andipaetzold committed Oct 15, 2021
1 parent 046f92a commit 981ec92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/firestore/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function getDocsFromSource<Value extends DocumentData = DocumentDat
* @internal
*/
function isDocRefEqual<Value>(a: DocumentReference<Value> | undefined, b: DocumentReference<Value> | undefined): boolean {
const areBothUndefined = a === undefined || b === undefined;
const areBothUndefined = a === undefined && b === undefined;
const areSameRef = a !== undefined && b !== undefined && refEqual(a, b);
return areBothUndefined || areSameRef;
}
Expand All @@ -72,7 +72,7 @@ export function useStableDocRef<Value>(
* @internal
*/
function isQueryEqual<Value>(a: Query<Value> | undefined, b: Query<Value> | undefined): boolean {
const areBothUndefined = a === undefined || b === undefined;
const areBothUndefined = a === undefined && b === undefined;
const areSameRef = a !== undefined && b !== undefined && queryEqual(a, b);
return areBothUndefined || areSameRef;
}
Expand Down

0 comments on commit 981ec92

Please sign in to comment.