This commit is contained in:
ehesp
2019-08-07 10:54:38 +01:00
parent 18a3023901
commit b1d140cfc7
3 changed files with 3 additions and 5 deletions

View File

@@ -58,6 +58,7 @@ export default class DatabaseDataSnapshot {
if (value === undefined) {
value = null;
}
const childRef = this._ref.child(path);
return new DatabaseDataSnapshot(childRef, {

View File

@@ -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,

View File

@@ -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');
});