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

[web] SL history: fix incorrect `var`->`let` replacement (#8994)

GitOrigin-RevId: ea90be7d89f6c31156a30af3278218f93f1d5c6a
Miguel Serrano 4 лет назад
Родитель
Сommit
e9f7f19ca0
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      services/web/frontend/js/ide/history/controllers/HistoryListController.js

+ 5 - 1
services/web/frontend/js/ide/history/controllers/HistoryListController.js

@@ -62,7 +62,11 @@ App.controller('HistoryListController', function ($scope, $modal, ide) {
     return (() => {
     return (() => {
       const result = []
       const result = []
       for (const update of Array.from($scope.history.updates)) {
       for (const update of Array.from($scope.history.updates)) {
-        let inSelection
+        // replacing this declaration with `let` introduces a bug in history point selection:
+        // https://github.com/overleaf/overleaf/issues/1035
+        // eslint-disable-next-line no-var
+        var inSelection
+
         if (update.selectedTo) {
         if (update.selectedTo) {
           inSelection = true
           inSelection = true
           beforeSelection = false
           beforeSelection = false