From 23c0e9062f53c69f100dabee769652933f56544b Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 29 Mar 2016 08:54:13 +0200 Subject: [PATCH] refresh projects list after leaving a project --- app/coffee/modules/team/main.coffee | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/coffee/modules/team/main.coffee b/app/coffee/modules/team/main.coffee index 40b08514..eb69f789 100644 --- a/app/coffee/modules/team/main.coffee +++ b/app/coffee/modules/team/main.coffee @@ -225,7 +225,7 @@ module.directive("tgTeamMembers", TeamMembersDirective) ## Leave project Directive ############################################################################# -LeaveProjectDirective = ($repo, $confirm, $location, $rs, $navurls, $translate, lightboxFactory) -> +LeaveProjectDirective = ($repo, $confirm, $location, $rs, $navurls, $translate, lightboxFactory, currentUserService) -> link = ($scope, $el, $attrs) -> leaveConfirm = () -> leave_project_text = $translate.instant("TEAM.ACTION_LEAVE_PROJECT") @@ -235,9 +235,10 @@ LeaveProjectDirective = ($repo, $confirm, $location, $rs, $navurls, $translate, promise = $rs.projects.leave($scope.project.id) promise.then => - response.finish() - $confirm.notify("success") - $location.path($navurls.resolve("home")) + currentUserService.loadProjects().then () -> + response.finish() + $confirm.notify("success") + $location.path($navurls.resolve("home")) promise.then null, (response) -> response.finish() @@ -263,7 +264,7 @@ LeaveProjectDirective = ($repo, $confirm, $location, $rs, $navurls, $translate, link: link } -module.directive("tgLeaveProject", ["$tgRepo", "$tgConfirm", "$tgLocation", "$tgResources", "$tgNavUrls", "$translate", "tgLightboxFactory", +module.directive("tgLeaveProject", ["$tgRepo", "$tgConfirm", "$tgLocation", "$tgResources", "$tgNavUrls", "$translate", "tgLightboxFactory", "tgCurrentUserService", LeaveProjectDirective])