From e2c66e8d5687f08bf0e83df5caa49d77cb3424ef Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 31 Oct 2016 15:31:32 +0000 Subject: [PATCH] keep track of reconnect timer --- .../coffee/ide/connection/ConnectionManager.coffee | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/web/public/coffee/ide/connection/ConnectionManager.coffee b/services/web/public/coffee/ide/connection/ConnectionManager.coffee index 987186fd19..232b63e7cc 100644 --- a/services/web/public/coffee/ide/connection/ConnectionManager.coffee +++ b/services/web/public/coffee/ide/connection/ConnectionManager.coffee @@ -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--