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

Merge pull request #3397 from overleaf/em-out-of-sync

Reload page when dismissing out-of-sync modal

GitOrigin-RevId: cfb164a57969aa294bdbffb18f51077896529bed
Eric Mc Sween 5 лет назад
Родитель
Сommit
cb9b44141c
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      services/web/frontend/js/ide/services/ide.js

+ 8 - 2
services/web/frontend/js/ide/services/ide.js

@@ -87,6 +87,8 @@ App.factory('ide', function($http, queuedHttp, $modal, $q, $filter, $timeout) {
     $modal.open({
       templateUrl: 'outOfSyncModalTemplate',
       controller: 'OutOfSyncModalController',
+      backdrop: false, // not dismissable by clicking background
+      keyboard: false, // prevent dismiss via keyboard
       resolve: {
         title() {
           return title
@@ -136,7 +138,7 @@ App.controller('GenericMessageModalController', function(
 
 App.controller('OutOfSyncModalController', function(
   $scope,
-  $modalInstance,
+  $window,
   title,
   message,
   editorContent
@@ -145,7 +147,11 @@ App.controller('OutOfSyncModalController', function(
   $scope.message = message
   $scope.editorContent = editorContent
 
-  return ($scope.done = () => $modalInstance.close())
+  $scope.done = () => {
+    // Reload the page to avoid staying in an inconsistent state.
+    // https://github.com/overleaf/issues/issues/3694
+    $window.location.reload()
+  }
 })
 
 function __guard__(value, transform) {