GitHub PullRequestReviewCommentEvent at 2014-04-03 21:45:08
Repository: calcentral
Actor: christianv
Payload: {"comment":{"url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments/11274423","id":11274423,"diff_hunk":"@@ -6,9 +6,18 @@\n    */\n   angular.module('calcentral.controllers').controller('AlertsController', function(badgesFactory, $scope) {\n \n-    badgesFactory.getBadges().success(function(data) {\n-      $scope.alert = data.alert;\n+    var fetch = function() {\n+      badgesFactory.getBadges().success(function(data) {\n+        $scope.alert = data.alert;\n+      });\n+    };\n+\n+    $scope.$on('calcentral.api.updatedFeeds.updateServices', function(event, services) {\n+      if (services && services['MyBadges::Merged']) {\n+        fetch();\n+      }\n     });\n+    fetch();","path":"app/assets/javascripts/angular/controllers/widgets/alertsController.js","position":17,"original_position":17,"commit_id":"eee70a93b02ae3ed8924f046c1c34d8b5cc26a5b","original_commit_id":"eee70a93b02ae3ed8924f046c1c34d8b5cc26a5b","user":{"login":"christianv","id":127199,"avatar_url":"https://avatars.githubusercontent.com/u/127199?","gravatar_id":"7ef7ea08be8b62f753c64405f23aa520","url":"https://api.github.com/users/christianv","html_url":"https://github.com/christianv","followers_url":"https://api.github.com/users/christianv/followers","following_url":"https://api.github.com/users/christianv/following{/other_user}","gists_url":"https://api.github.com/users/christianv/gists{/gist_id}","starred_url":"https://api.github.com/users/christianv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianv/subscriptions","organizations_url":"https://api.github.com/users/christianv/orgs","repos_url":"https://api.github.com/users/christianv/repos","events_url":"https://api.github.com/users/christianv/events{/privacy}","received_events_url":"https://api.github.com/users/christianv/received_events","type":"User","site_admin":false},"body":"@chikoon outside the condition is because we need to do it as soon as the controller loads. Inside the condition, we do it because we also need to fetch the feed again when there were any updates.","created_at":"2014-04-03T21:45:08Z","updated_at":"2014-04-03T21:45:08Z","html_url":"https://github.com/ets-berkeley-edu/calcentral/pull/2349#discussion_r11274423","pull_request_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/2349","_links":{"self":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments/11274423"},"html":{"href":"https://github.com/ets-berkeley-edu/calcentral/pull/2349#discussion_r11274423"},"pull_request":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/2349"}}}}