From 38e0fcdb9eb76bb572baff61682b7341ffe07cd2 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 8 Jun 2015 13:34:12 +0200 Subject: [PATCH] fix issue #2788 - hide menu when the user is not inside a project --- app/coffee/app.coffee | 2 ++ app/modules/services/project.service.coffee | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index b70fdea8..76c62b83 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -512,6 +512,8 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na if next.params.pslug projectService.setProject(next.params.pslug) + else + projectService.cleanProject() if next.title $translate(next.title).then (text) => $appTitle.set(text) diff --git a/app/modules/services/project.service.coffee b/app/modules/services/project.service.coffee index fcb67493..9fe2902c 100644 --- a/app/modules/services/project.service.coffee +++ b/app/modules/services/project.service.coffee @@ -28,6 +28,12 @@ class ProjectService @.fetchProject() + cleanProject: () -> + @._pslug = null + @._project = null + @._section = null + @._sectionsBreadcrumb = Immutable.List() + fetchProject: () -> return @projectsService.getProjectBySlug(@._pslug).then (project) => @._project = project