Просмотр исходного кода

fix lastUpdate in ConnectionManager

Brian Gough 10 лет назад
Родитель
Сommit
f894048292
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      services/web/public/coffee/ide/connection/ConnectionManager.coffee

+ 2 - 2
services/web/public/coffee/ide/connection/ConnectionManager.coffee

@@ -39,7 +39,7 @@ define [], () ->
 				@tryReconnect()
 				@tryReconnect()
 
 
 			@$scope.$on 'cursor:editor:update', () =>
 			@$scope.$on 'cursor:editor:update', () =>
-				@lastUserAction = new Date()
+				@lastUserAction = new Date()  # time of last edit
 				if !@connected
 				if !@connected
 					@tryReconnect()
 					@tryReconnect()
 
 
@@ -170,7 +170,7 @@ define [], () ->
 
 
 		startAutoReconnectCountdown: () ->
 		startAutoReconnectCountdown: () ->
 			twoMinutes = 2 * 60 * 1000
 			twoMinutes = 2 * 60 * 1000
-			if @lastUpdated? and new Date() - @lastUpdated > twoMinutes
+			if @lastUserAction? and new Date() - @lastUserAction > twoMinutes
 				# between 1 minute and 3 minutes
 				# between 1 minute and 3 minutes
 				countdown = 60 + Math.floor(Math.random() * 120)
 				countdown = 60 + Math.floor(Math.random() * 120)
 			else
 			else