Skip to content

Commit

Permalink
use data.sync_keys, not data.id to identify data type
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed May 22, 2020
1 parent 8490e0c commit b2d3aef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/ArSyncStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,11 @@ class ArSyncCollection extends ArSyncContainerBase {
const newData: any[] = []
for (const subData of collection) {
let model: ArSyncRecord | undefined = undefined
if (typeof(subData) === 'object' && subData && 'id' in subData) model = existings.get(subData.id)
if (typeof(subData) === 'object' && subData && 'sync_keys' in subData) model = existings.get(subData.id)
let data = subData
if (model) {
model.replaceData(subData)
} else if (subData.id) {
} else if (subData.sync_keys) {
model = new ArSyncRecord(this.query, subData, null, this.root)
model.parentModel = this
model.parentKey = subData.id
Expand Down

0 comments on commit b2d3aef

Please sign in to comment.