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