NewChannel: redirect DM creation from DM routes
We were redirecting based on our parent path, so if we were in a DM
while making a DM, we used that DM as our parent path.
Fixes urbit/landscape#421
@@ -100,7 +100,7 @@ export function NewChannel(props: NewChannelProps & RouteComponentProps) {
await waiter(p => Boolean(p?.groups?.[`/ship/~${window.ship}/${resId}`]));
}
actions.setStatus({ success: null });
- const resourceUrl = parentPath(location.pathname);
+ const resourceUrl = (location.pathname.includes("/messages")) ? "/~landscape/messages" : parentPath(location.pathname);
history.push(
`${resourceUrl}/resource/${moduleType}/ship/~${window.ship}/${resId}`
);
