From 4abf6ed38cde3103e6c6ce4b176980060000f7b8 Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 24 Jul 2014 15:59:24 +0100 Subject: [PATCH] Show message and auto refresh on force disconnect --- .../coffee/ide/connection/ConnectionManager.coffee | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/services/web/public/coffee/ide/connection/ConnectionManager.coffee b/services/web/public/coffee/ide/connection/ConnectionManager.coffee index f91aad1288..0ec83c7e08 100644 --- a/services/web/public/coffee/ide/connection/ConnectionManager.coffee +++ b/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