mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-29 19:38:48 +08:00
fix(nylas-api): The _delta property was not correctly associated with deltas
This commit is contained in:
parent
58a9d60ce1
commit
b5ac2b5c4c
1 changed files with 2 additions and 2 deletions
|
@ -260,7 +260,7 @@ class NylasAPI
|
|||
# Create a (non-enumerable) reference from the attributes which we carry forward
|
||||
# back to their original deltas. This allows us to mark the deltas that the
|
||||
# app ignores later in the process.
|
||||
for delta in deltas
|
||||
deltas.forEach (delta) ->
|
||||
if delta.attributes
|
||||
Object.defineProperty(delta.attributes, '_delta', { get: -> delta })
|
||||
|
||||
|
@ -350,7 +350,7 @@ class NylasAPI
|
|||
DatabaseStore = require './stores/database-store'
|
||||
DatabaseStore.findVersions(klass, ids).then (versions) ->
|
||||
accepted = accepted.filter (json) ->
|
||||
if versions[json.id] >= json.version
|
||||
if json.version and versions[json.id] >= json.version
|
||||
json._delta?.ignoredBecause = "This version (#{json.version}) is not newer. Already have (#{versions[json.id]})"
|
||||
return false
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue