From d263bffb1ac20bb503ec1280f27c7db9222e83b8 Mon Sep 17 00:00:00 2001 From: Alana Luyten Date: Mon, 18 Mar 2024 14:40:10 +0100 Subject: [PATCH] fix(project): revert handling of missing current route information Instance-links don't correctly redirect to the relevant project. Handling null accesses currently leads to display issues in the navigation and need to be properly addressed and fixed. --- addon/controllers/project.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addon/controllers/project.js b/addon/controllers/project.js index 3319e7b4..4cd0ad97 100644 --- a/addon/controllers/project.js +++ b/addon/controllers/project.js @@ -10,7 +10,7 @@ export default class ProjectController extends Controller { @service constructionProject; get activeProjectId() { - return Number(this.router.externalRouter.currentRoute?.params.project_id); + return Number(this.router.externalRouter.currentRoute.params.project_id); } get isLoading() { @@ -20,8 +20,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.router.externalRouter.currentRoute.localName !== "new" && + this.router.externalRouter.currentRoute.localName !== "errors" ); }