Skip to content

Commit f56439b

Browse files
committed
chore: fromCache change
1 parent b8087f5 commit f56439b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/actions/firestore.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ export function get(firebase, dispatch, queryOption) {
9898
data: dataByIdSnapshot(snap),
9999
ordered: orderedFromSnap(snap),
100100
fromCache:
101-
(typeof snap.metadata?.fromCache === 'boolean' &&
102-
snap.metadata.fromCache) ||
103-
true,
101+
typeof snap.metadata?.fromCache === 'boolean'
102+
? snap.metadata.fromCache
103+
: true,
104104
}),
105105
merge: {
106106
docs: mergeOrdered && mergeOrderedDocUpdates,

src/utils/query.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -792,9 +792,9 @@ export function dispatchListenerResponse({
792792
mergeOrderedCollectionUpdates,
793793
} = firebase._.config || {};
794794
const fromCache =
795-
(typeof docData.metadata?.fromCache === 'boolean' &&
796-
docData.metadata.fromCache) ||
797-
true;
795+
typeof docData.metadata?.fromCache === 'boolean'
796+
? docData.metadata.fromCache
797+
: true;
798798
const docChanges =
799799
typeof docData.docChanges === 'function'
800800
? docData.docChanges()

0 commit comments

Comments
 (0)