mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-04 09:28:03 +08:00
Fixes #2448
This commit is contained in:
@@ -58,6 +58,7 @@ export default class DatabaseDataSnapshot {
|
||||
if (value === undefined) {
|
||||
value = null;
|
||||
}
|
||||
|
||||
const childRef = this._ref.child(path);
|
||||
|
||||
return new DatabaseDataSnapshot(childRef, {
|
||||
|
||||
@@ -289,7 +289,7 @@ export default class DatabaseQuery extends ReferenceBase {
|
||||
// Add a new SyncTree registration
|
||||
DatabaseSyncTree.addRegistration({
|
||||
eventType,
|
||||
ref: this, // Not this.ref?
|
||||
ref: this.ref,
|
||||
path: this.path,
|
||||
key: queryKey,
|
||||
appName: this._database.app.name,
|
||||
@@ -304,7 +304,7 @@ export default class DatabaseQuery extends ReferenceBase {
|
||||
// to occur either, only happens on failure to register on native
|
||||
|
||||
DatabaseSyncTree.addRegistration({
|
||||
ref: this,
|
||||
ref: this.ref,
|
||||
once: true,
|
||||
path: this.path,
|
||||
key: queryKey,
|
||||
@@ -316,8 +316,6 @@ export default class DatabaseQuery extends ReferenceBase {
|
||||
});
|
||||
}
|
||||
|
||||
// TODO appName, DB already passed along?
|
||||
// TODO what needs going into the object?
|
||||
this._database.native.on({
|
||||
eventType,
|
||||
path: this.path,
|
||||
|
||||
@@ -72,7 +72,6 @@ describe('firestore.QuerySnapshot', () => {
|
||||
it('returns a Query instance', async () => {
|
||||
const colRef = firebase.firestore().collection('v6');
|
||||
const snapshot = await colRef.get();
|
||||
// TODO is this correct? CollectionReference extends Query?
|
||||
snapshot.query.constructor.name.should.eql('FirestoreCollectionReference');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user