mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
keep track of reconnect timer
This commit is contained in:
parent
4da9008300
commit
e2c66e8d56
1 changed files with 8 additions and 2 deletions
|
@ -192,10 +192,16 @@ define [], () ->
|
|||
, 200)
|
||||
|
||||
cancelReconnect: () ->
|
||||
clearTimeout @timeoutId if @timeoutId?
|
||||
|
||||
# clear timeout and set to null so we know there is no countdown running
|
||||
if @timeoutId?
|
||||
sl_console.log "[ConnectionManager] cancelling existing reconnect timer"
|
||||
clearTimeout @timeoutId
|
||||
@timeoutId = null
|
||||
|
||||
decreaseCountdown: () ->
|
||||
@timeoutId = null
|
||||
return if !@$scope.connection.reconnection_countdown?
|
||||
sl_console.log "[ConnectionManager] decreasing countdown", @$scope.connection.reconnection_countdown
|
||||
@$scope.$apply () =>
|
||||
@$scope.connection.reconnection_countdown--
|
||||
|
||||
|
|
Loading…
Reference in a new issue