Fixed bug: New model record won't get refreshed in current function call as it should be if param 'later' is given.
This commit is contained in:
parent
4f6b0f7384
commit
b4ffbc963c
1 changed files with 9 additions and 10 deletions
|
@ -110,19 +110,18 @@ class _collectionSingleton extends Spine.Module
|
|||
# check if new object is newer, just load newer objects
|
||||
if object.updated_at
|
||||
currentUpdatedAt = appObject.updatedAt(key)
|
||||
objectToLoad = undefined
|
||||
if currentUpdatedAt
|
||||
if currentUpdatedAt < object.updated_at
|
||||
objectToLoad = object
|
||||
@log 'debug', 'refresh newer', params.type, key
|
||||
if params.later
|
||||
listToRefreshLater.push object
|
||||
@log 'debug', 'refresh newer later', params.type, key
|
||||
else
|
||||
listToRefresh.push object
|
||||
@log 'debug', 'refresh newer', params.type, key
|
||||
|
||||
else
|
||||
objectToLoad = object
|
||||
@log 'debug', 'refresh try no updated_at', params.type, key
|
||||
if objectToLoad
|
||||
if params.later
|
||||
listToRefreshLater.push objectToLoad
|
||||
else
|
||||
listToRefresh.push object
|
||||
listToRefresh.push object
|
||||
@log 'debug', 'refresh new no current updated_at', params.type, key
|
||||
else
|
||||
listToRefresh.push object
|
||||
@log 'debug', 'refresh new', params.type, key
|
||||
|
|
Loading…
Reference in a new issue