소스 검색

keep track of reconnect timer

Brian Gough 10 년 전
부모
커밋
e2c66e8d56
1개의 변경된 파일과 8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      services/web/public/coffee/ide/connection/ConnectionManager.coffee

+ 8 - 2
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--