Skip to content

Commit

Permalink
fix(projects): fix detection of active project id
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Mar 19, 2024
1 parent 62635df commit c9df3d4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions addon/controllers/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ export default class ProjectController extends Controller {
@service config;
@service constructionProject;

get currentRoute() {
return this.router.externalRouter.recognize(
this.router.externalRouter.currentURL,
);
}

get activeProjectId() {
return Number(this.router.externalRouter.currentRoute.params.project_id);
return Number(this.currentRoute.params.project_id);
}

get isLoading() {
Expand All @@ -20,8 +26,8 @@ export default class ProjectController extends Controller {
get displayLandingPage() {
return (
!this.projects.value?.length &&
this.router.externalRouter.currentRoute.localName !== "new" &&
this.router.externalRouter.currentRoute.localName !== "errors"
this.currentRoute.localName !== "new" &&
this.currentRoute.localName !== "errors"
);
}

Expand Down

0 comments on commit c9df3d4

Please sign in to comment.