Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: in to include
Browse files Browse the repository at this point in the history
  • Loading branch information
ishowta committed Feb 15, 2022
1 parent dafa6bf commit d2d4f7e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/GraphQueryListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ export class GraphQueryListener {
const newSnapshotKeys = Object.keys(newSnapshot);
for (const snapshotKey of union(prevSnapshotKeys, newSnapshotKeys)) {
if (
snapshotKey in prevSnapshotKeys &&
!(snapshotKey in newSnapshotKeys)
prevSnapshotKeys.includes(snapshotKey) &&
!newSnapshotKeys.includes(snapshotKey)
) {
// key removed
this.logger.debug('key removed');
Expand All @@ -291,8 +291,8 @@ export class GraphQueryListener {
}
}
if (
!(snapshotKey in prevSnapshotKeys) &&
snapshotKey in newSnapshotKeys
!prevSnapshotKeys.includes(snapshotKey) &&
newSnapshotKeys.includes(snapshotKey)
) {
// key created
this.logger.debug('key created');
Expand All @@ -305,7 +305,10 @@ export class GraphQueryListener {
this.createSubQueryListener(newSnapshot, snapshotKey, newQuery);
}
}
if (snapshotKey in prevSnapshotKeys && snapshotKey in newSnapshotKeys) {
if (
prevSnapshotKeys.includes(snapshotKey) &&
newSnapshotKeys.includes(snapshotKey)
) {
// key not changed
if (!dryRun && this.result) {
this.result['data'][snapshotKey] = newSnapshot.data[snapshotKey];
Expand Down

0 comments on commit d2d4f7e

Please sign in to comment.