mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
Don't insert a null update if there are no updates or raw updates
This commit is contained in:
parent
fe503010aa
commit
07f078b527
1 changed files with 5 additions and 1 deletions
|
@ -59,6 +59,10 @@ module.exports = ConversionManager =
|
||||||
if !lastCompressedUpdate?
|
if !lastCompressedUpdate?
|
||||||
lastCompressedUpdate = rawUpdates.shift()
|
lastCompressedUpdate = rawUpdates.shift()
|
||||||
|
|
||||||
|
if !lastCompressedUpdate?
|
||||||
|
# No saved versions, no raw updates, nothing to do
|
||||||
|
callback()
|
||||||
|
|
||||||
compressedUpdates = [lastCompressedUpdate]
|
compressedUpdates = [lastCompressedUpdate]
|
||||||
for rawUpdate in rawUpdates
|
for rawUpdate in rawUpdates
|
||||||
lastCompressedUpdate = compressedUpdates.pop()
|
lastCompressedUpdate = compressedUpdates.pop()
|
||||||
|
@ -69,5 +73,5 @@ module.exports = ConversionManager =
|
||||||
ConversionManager.insertCompressedUpdates doc_id, compressedUpdates, (error) ->
|
ConversionManager.insertCompressedUpdates doc_id, compressedUpdates, (error) ->
|
||||||
return callback(error) if error?
|
return callback(error) if error?
|
||||||
console.log doc_id, "Pushed doc ops", length
|
console.log doc_id, "Pushed doc ops", length
|
||||||
callback null, true
|
callback()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue