From 5fb54d8447d59783e93f54313e2c59558055ada5 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 16 Jan 2017 16:55:14 +0100 Subject: [PATCH] Don't refresh resolved comments every times an entry changes --- .../controllers/ReviewPanelController.coffee | 11 ++++++----- .../directives/resolvedCommentsDropdown.coffee | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee index 4c65208ad9..656cb6c9f0 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -163,11 +163,12 @@ define [ $scope.refreshResolvedCommentsDropdown = () -> $scope.reviewPanel.dropdown.loading = true - refreshRanges() - .then () -> - $scope.reviewPanel.dropdown.loading = false - .catch () -> - $scope.reviewPanel.dropdown.loading = false + q = refreshRanges() + q.then () -> + $scope.reviewPanel.dropdown.loading = false + q.catch () -> + $scope.reviewPanel.dropdown.loading = false + return q updateEntries = (doc_id) -> rangesTracker = getChangeTracker(doc_id) diff --git a/services/web/public/coffee/ide/review-panel/directives/resolvedCommentsDropdown.coffee b/services/web/public/coffee/ide/review-panel/directives/resolvedCommentsDropdown.coffee index f161338324..e70dcaf1ec 100644 --- a/services/web/public/coffee/ide/review-panel/directives/resolvedCommentsDropdown.coffee +++ b/services/web/public/coffee/ide/review-panel/directives/resolvedCommentsDropdown.coffee @@ -23,6 +23,7 @@ define [ scope.state.isOpen = !scope.state.isOpen if (scope.state.isOpen) scope.onOpen() + .then () -> filterResolvedComments() scope.resolvedComments = [] @@ -54,5 +55,3 @@ define [ resolvedComment.docName = getDocNameById(docId) scope.resolvedComments.push(resolvedComment) - - scope.$on "entries:changed", filterResolvedComments \ No newline at end of file