Merge pull request #401 from taigaio/bug/2374/clearing-projects-when-log-out

Bug 2374 - The projects cache isn't cleared properly when a user logs ou...
stable
David Barragán Merino 2015-03-13 12:34:04 +01:00
commit dd19aeacfc
1 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ class ProjectsController extends taiga.Controller
promise = @.loadInitialData()
promise.then () =>
@scope.$emit("projects:loaded")
@scope.$emit("projects:loaded", @.projects)
promise.then null, @.onInitialDataError.bind(@)
@ -257,8 +257,8 @@ ProjectsListDirective = ($compile, $template) ->
$el.html($compile(template({projects: projects}))($scope))
$scope.$emit("regenerate:project-pagination")
$scope.$watch "projects", (projects) ->
render(projects) if projects?
$scope.$on "projects:loaded", (ctx, projects) ->
render(projects.all) if projects.all?
return {
link: link