[database][js] ref.isEqual() now correctly compares query modifiers
This commit is contained in:
parent
590cb58d49
commit
f90db16019
|
@ -428,7 +428,6 @@ export default class Reference extends ReferenceBase {
|
||||||
return this.path;
|
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
|
* Returns whether another Reference represent the same location and are from the
|
||||||
* same instance of firebase.app.App - multiple firebase apps not currently supported.
|
* 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}
|
* {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#isEqual}
|
||||||
*/
|
*/
|
||||||
isEqual(otherRef: Reference): boolean {
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue