From 9a1ef3799108dca5d01b96e69058ec634b17fc36 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 14 Dec 2020 09:29:45 +0000 Subject: [PATCH] Merge pull request #3484 from overleaf/jpa-hide-ui-below-out-of-sync [frontend] hide ui elements below the out-of-sync modal GitOrigin-RevId: 4e48b402522531524f347c784c58f4589b753997 --- services/web/app/views/project/editor.pug | 2 +- services/web/app/views/project/editor/editor.pug | 4 ++-- services/web/frontend/js/ide/editor/EditorManager.js | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/services/web/app/views/project/editor.pug b/services/web/app/views/project/editor.pug index 2b09ad54e6..28242837f2 100644 --- a/services/web/app/views/project/editor.pug +++ b/services/web/app/views/project/editor.pug @@ -20,7 +20,7 @@ block content p.loading-screen-error(ng-if="state.error").ng-cloak span(ng-bind-html="state.error") - .global-alerts(ng-cloak) + .global-alerts(ng-cloak ng-hide="editor.error_state") .alert.alert-danger.small(ng-if="connection.forced_disconnect") strong #{translate("disconnected")} | #{translate("please_refresh")} diff --git a/services/web/app/views/project/editor/editor.pug b/services/web/app/views/project/editor/editor.pug index 2c544e0504..3846b967b7 100644 --- a/services/web/app/views/project/editor/editor.pug +++ b/services/web/app/views/project/editor/editor.pug @@ -27,7 +27,7 @@ div.full-size( }" ) .loading-panel( - ng-show="!editor.sharejs_doc || editor.opening", + ng-show="(!editor.sharejs_doc || editor.opening) && !editor.error_state", style=showRichText ? "top: 32px" : "", ) span(ng-show="editor.open_doc_id") @@ -51,7 +51,7 @@ div.full-size( #editor( ace-editor="editor", ng-if="!editor.showRichText", - ng-show="!!editor.sharejs_doc && !editor.opening && multiSelectedCount === 0", + ng-show="!!editor.sharejs_doc && !editor.opening && multiSelectedCount === 0 && !editor.error_state", theme="settings.editorTheme", keybindings="settings.mode", font-size="settings.fontSize", diff --git a/services/web/frontend/js/ide/editor/EditorManager.js b/services/web/frontend/js/ide/editor/EditorManager.js index c1ccf56d80..db2305f86e 100644 --- a/services/web/frontend/js/ide/editor/EditorManager.js +++ b/services/web/frontend/js/ide/editor/EditorManager.js @@ -319,6 +319,9 @@ export default (EditorManager = (function() { this.ide.socket.disconnect() this.ide.reportError(error, meta) + + // Tell the user about the error state. + this.$scope.editor.error_state = true this.ide.showOutOfSyncModal( 'Out of sync', "Sorry, this file has gone out of sync and we need to do a full refresh.
Please see this help guide for more information",