Skip to content

Commit b8087f5

Browse files
committed
fix: fromCache
1 parent 5a356a5 commit b8087f5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/actions/firestore.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ export function get(firebase, dispatch, queryOption) {
9898
data: dataByIdSnapshot(snap),
9999
ordered: orderedFromSnap(snap),
100100
fromCache:
101-
(snap.metadata && typeof snap.metadata.fromCache === 'boolean') ||
101+
(typeof snap.metadata?.fromCache === 'boolean' &&
102+
snap.metadata.fromCache) ||
102103
true,
103104
}),
104105
merge: {

src/utils/query.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,8 @@ export function dispatchListenerResponse({
792792
mergeOrderedCollectionUpdates,
793793
} = firebase._.config || {};
794794
const fromCache =
795-
(docData.metadata && typeof docData.metadata.fromCache === 'boolean') ||
795+
(typeof docData.metadata?.fromCache === 'boolean' &&
796+
docData.metadata.fromCache) ||
796797
true;
797798
const docChanges =
798799
typeof docData.docChanges === 'function'

0 commit comments

Comments
 (0)