瀏覽代碼

Show message and auto refresh on force disconnect

James Allen 12 年之前
父節點
當前提交
4abf6ed38c
共有 1 個文件被更改,包括 11 次插入 和 2 次删除
  1. 11 2
      services/web/public/coffee/ide/connection/ConnectionManager.coffee

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

@@ -47,9 +47,18 @@ define [], () ->
 
 			@ide.socket.on 'forceDisconnect', (message) =>
 				@$scope.$apply () =>
+					@$scope.permissions.write = false
 					@$scope.connection.forced_disconnect = true
-				@socket.disconnect()
-
+				@ide.socket.socket.disconnect()
+				@ide.showGenericMessageModal("Please Refresh", """
+					We're performing maintenance on ShareLaTeX and you need to refresh the editor.
+					Sorry for any inconvenience.
+					The editor will refresh in automatically in 10 seconds.
+				""")
+				setTimeout () ->
+					location.reload()
+				, 10 * 1000
+				
 		joinProject: () ->
 			@ide.socket.emit 'joinProject', {
 				project_id: @ide.project_id