Skip to content

Commit ba384c2

Browse files
committed
fix(firestore): onSnapshot handling
1 parent 161af8a commit ba384c2

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

packages/firebase-firestore/index.android.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,13 @@ export class Query<T extends DocumentData = DocumentData> implements IQuery<T> {
543543
}
544544
} else {
545545
if (error) {
546-
onError?.(FirebaseError.fromNative(error));
546+
// onNext -> onError
547+
onNext?.(FirebaseError.fromNative(error));
547548
} else {
548-
onCompletion?.();
549-
onNext?.(QuerySnapshot.fromNative(ss));
549+
// onError -> onCompletion
550+
onError?.();
551+
// options -> onNext
552+
options?.(QuerySnapshot.fromNative(ss));
550553
}
551554
}
552555
} else {

packages/firebase-firestore/index.ios.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,13 @@ export class Query<T extends DocumentData = DocumentData> implements IQuery<T> {
476476
}
477477
} else {
478478
if (error) {
479-
onError?.(FirebaseError.fromNative(error));
479+
// onNext -> onError
480+
onNext?.(FirebaseError.fromNative(error));
480481
} else {
481-
onCompletion?.();
482-
onNext?.(QuerySnapshot.fromNative(ss));
482+
// onError -> onCompletion
483+
onError?.();
484+
// options -> onNext
485+
options?.(QuerySnapshot.fromNative(ss));
483486
}
484487
}
485488
} else {

0 commit comments

Comments
 (0)