mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Handle if two updates cancel each other
This commit is contained in:
parent
54c7959647
commit
3ab45c2a35
1 changed files with 4 additions and 1 deletions
|
@ -40,7 +40,10 @@ module.exports = ConversionManager =
|
||||||
compressedUpdates = [lastCompressedUpdate]
|
compressedUpdates = [lastCompressedUpdate]
|
||||||
for rawUpdate in rawUpdates
|
for rawUpdate in rawUpdates
|
||||||
lastCompressedUpdate = compressedUpdates.pop()
|
lastCompressedUpdate = compressedUpdates.pop()
|
||||||
|
if lastCompressedUpdate?
|
||||||
compressedUpdates = compressedUpdates.concat ConcatManager.concatTwoUpdates lastCompressedUpdate, rawUpdate
|
compressedUpdates = compressedUpdates.concat ConcatManager.concatTwoUpdates lastCompressedUpdate, rawUpdate
|
||||||
|
else
|
||||||
|
compressedUpdates.push rawUpdate
|
||||||
ConversionManager.removeLatestCompressedUpdate doc_id, (error) ->
|
ConversionManager.removeLatestCompressedUpdate doc_id, (error) ->
|
||||||
return callback(error) if error?
|
return callback(error) if error?
|
||||||
callback null, compressedUpdates
|
callback null, compressedUpdates
|
||||||
|
|
Loading…
Reference in a new issue