diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index 492c3795e8..f1bacaecfd 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -13,7 +13,9 @@ block content h3 #{translate("loading")}... .progress .progress-bar(style="width: 20%", ng-style="{'width': state.load_progress + '%'}") - p.text-center.text-danger(ng-if="state.error").ng-cloak {{ state.error }} + p.text-center.text-danger(ng-if="state.error").ng-cloak + span(ng-bind-html="state.error") + .global-alerts(ng-cloak) .alert.alert-danger.small(ng-if="connection.forced_disconnect") diff --git a/services/web/public/coffee/ide/connection/ConnectionManager.coffee b/services/web/public/coffee/ide/connection/ConnectionManager.coffee index e6c9597f68..febe1a9f97 100644 --- a/services/web/public/coffee/ide/connection/ConnectionManager.coffee +++ b/services/web/public/coffee/ide/connection/ConnectionManager.coffee @@ -29,6 +29,7 @@ define [], () -> @ide.socket = io.connect null, reconnect: false + 'connect timeout': 30 * 1000 "force new connection": true @ide.socket.on "connect", () => @@ -44,6 +45,13 @@ define [], () -> @joinProject() , 100) + @ide.socket.on "connect_failed", () => + @connected = false + $scope.$apply () => + @$scope.state.error = "Unable to connect, please view the connection problems guide to fix the issue." + + + @ide.socket.on 'disconnect', () => @connected = false @ide.pushEvent("disconnected")