mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Handle if two updates cancel each other
This commit is contained in:
@@ -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()
|
||||||
compressedUpdates = compressedUpdates.concat ConcatManager.concatTwoUpdates lastCompressedUpdate, rawUpdate
|
if lastCompressedUpdate?
|
||||||
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user