mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 19:05:48 +03:00
JoinGroup: redirect if we have the group
Joining a group we have fails. We now redirect to the workspace. Fixes urbit/landscape#683
This commit is contained in:
parent
1ae61a0715
commit
3245465281
@ -81,6 +81,9 @@ export function JoinGroup(props: JoinGroupProps): ReactElement {
|
||||
if(group === TUTORIAL_GROUP_RESOURCE) {
|
||||
await api.settings.putEntry('tutorial', 'joined', Date.now());
|
||||
}
|
||||
if (group in groups) {
|
||||
return history.push(`/~landscape${group}`);
|
||||
}
|
||||
await api.groups.join(ship, name);
|
||||
try {
|
||||
await waiter((p) => {
|
||||
@ -111,6 +114,9 @@ export function JoinGroup(props: JoinGroupProps): ReactElement {
|
||||
async (values: FormSchema, actions: FormikHelpers<FormSchema>) => {
|
||||
const [ship, name] = values.group.split('/');
|
||||
const path = `/ship/${ship}/${name}`;
|
||||
if (path in groups) {
|
||||
return history.push(`/~landscape${path}`);
|
||||
}
|
||||
// skip if it's unmanaged
|
||||
try {
|
||||
const prev = await api.metadata.preview(path);
|
||||
|
Loading…
Reference in New Issue
Block a user