[database][js] ref.isEqual() now correctly compares query modifiers

This commit is contained in:
Salakar 2017-08-14 13:51:52 +01:00
parent 590cb58d49
commit f90db16019
1 changed files with 4 additions and 2 deletions

View File

@ -428,7 +428,6 @@ export default class Reference extends ReferenceBase {
return this.path;
}
// TODO should check query modifiers and if same app instance
/**
* Returns whether another Reference represent the same location and are from the
* same instance of firebase.app.App - multiple firebase apps not currently supported.
@ -438,7 +437,10 @@ export default class Reference extends ReferenceBase {
* {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#isEqual}
*/
isEqual(otherRef: Reference): boolean {
return !!otherRef && otherRef.constructor === Reference && otherRef.key === this.key;
return !!otherRef
&& otherRef.constructor === Reference
&& otherRef.key === this.key
&& this._query.queryIdentifier() === otherRef._query.queryIdentifier();
}
/**