Don't show saving just because of pending ops

When typing continuously, there is always a pending op present.
The only time we're not saving is if the inflight op isn't changing.
So long as this has changed, it means the previous one has been processed.
This commit is contained in:
James Allen 2016-05-27 14:08:46 +01:00
parent 4bc31ae2b9
commit a605dae7ba

View file

@ -146,12 +146,15 @@ define [
if !inflightOp? and !pendingOp? if !inflightOp? and !pendingOp?
# there's nothing going on # there's nothing going on
saved = true saved = true
else if inflightOp == @oldInflightOp sl_console.log "[pollSavedStatus] no inflight or pending ops"
saved = false else if inflightOp? and inflightOp == @oldInflightOp
else if pendingOp? # The same inflight op has been sitting unacked since we
# last checked.
saved = false saved = false
sl_console.log "[pollSavedStatus] inflight op is same as before"
else else
saved = true saved = true
sl_console.log "[pollSavedStatus] assuming saved (inflightOp?: #{inflightOp?}, pendingOp?: #{pendingOp?})"
@oldInflightOp = inflightOp @oldInflightOp = inflightOp
return saved return saved