瀏覽代碼

Merge pull request #2966 from overleaf/cmg-jpa-tags-update-propagation

Remove tag in place instead of replacing array

GitOrigin-RevId: 779577e8981e37508d20364903a843795c36dffe
Jakob Ackermann 6 年之前
父節點
當前提交
6050de114e
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      services/web/frontend/js/main/project-list/tag-controllers.js

+ 3 - 2
services/web/frontend/js/main/project-list/tag-controllers.js

@@ -63,8 +63,9 @@ App.controller('TagListController', function($scope, $modal) {
           project.tags.splice(index, 1)
         }
       }
-      // Remove tag
-      $scope.tags = $scope.tags.filter(t => t !== tag)
+
+      // Remove tag in place to update the state everywhere
+      $scope.tags.splice($scope.tags.indexOf(tag), 1)
     })
   }