From c03c1bfe8e6a03b6d545b4b9d020516ed68ba33c Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Thu, 15 Oct 2020 12:10:09 -0400 Subject: [PATCH] landscape: check workspace in channel menu --- .../src/views/landscape/components/ChannelMenu.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/ChannelMenu.tsx b/pkg/interface/src/views/landscape/components/ChannelMenu.tsx index 2dccd070a7..d532e67764 100644 --- a/pkg/interface/src/views/landscape/components/ChannelMenu.tsx +++ b/pkg/interface/src/views/landscape/components/ChannelMenu.tsx @@ -34,7 +34,9 @@ export function ChannelMenu(props: ChannelMenuProps) { const history = useHistory(); const { metadata } = association; const app = metadata.module || association["app-name"]; - const baseUrl = `/~landscape${association?.["group-path"]}/resource/${app}${association["app-path"]}`; + const workspace = history.location.pathname.startsWith('/~landscape/home') + ? '/home' : association?.['group-path']; + const baseUrl = `/~landscape${workspace}/resource/${app}${association["app-path"]}`; const appPath = association["app-path"]; const [, ship, name] = appPath.startsWith("/ship/") @@ -59,7 +61,7 @@ export function ChannelMenu(props: ChannelMenuProps) { default: throw new Error("Invalid app name"); } - history.push(`/~landscape${association?.["group-path"]}`); + history.push(`/~landscape${workspace}`); }, [api, association]); const onDelete = useCallback(async () => { @@ -77,7 +79,7 @@ export function ChannelMenu(props: ChannelMenuProps) { default: throw new Error("Invalid app name"); } - history.push(`/~landscape${association?.["group-path"]}`); + history.push(`/~landscape${workspace}`); }, [api, association]); return (