mirror of
https://github.com/urbit/shrub.git
synced 2024-12-26 13:31:36 +03:00
Merge pull request #3722 from urbit/mp/landscape/channel-menu
landscape: check workspace in channel menu
This commit is contained in:
commit
e7b1f840f7
@ -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 (
|
||||
|
Loading…
Reference in New Issue
Block a user