From d1eea59bd3d48ba7fa308c58124ce80f3a14fef3 Mon Sep 17 00:00:00 2001 From: Musaab Elfaqih Date: Fri, 17 Jan 2025 17:33:47 +0100 Subject: [PATCH] Address PR comments Signed-off-by: Musaab Elfaqih --- .../frontend-app-api/src/wiring/createSpecializedApp.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx b/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx index 1cb6aaf122..e80cd42435 100644 --- a/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx +++ b/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx @@ -122,16 +122,16 @@ class AppTreeApiProxy implements AppTreeApi { this.checkIfInitialized(); let path = sourcePath; - if (sourcePath.startsWith(this.appBasePath)) { - path = sourcePath.slice(this.appBasePath.length); + if (path.startsWith(this.appBasePath)) { + path = path.slice(this.appBasePath.length); } const matchedRoutes = matchRoutes(this.#routeInfo!.routeObjects, path); const matchedAppNodes = matchedRoutes - ?.filter(routeObj => !!routeObj.route.appNode) - .map(routeObj => routeObj.route.appNode!) || []; + ?.map(routeObj => routeObj.route.appNode) + .filter(appNode => !!appNode) || []; return { nodes: matchedAppNodes }; }