mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 19:05:48 +03:00
Merge pull request #5576 from urbit/lf/no-perms-rejoin
groups: fix rejoining a group after an error
This commit is contained in:
commit
2d95a34f7c
@ -143,6 +143,8 @@ function PendingGroup(props: PendingGroupProps) {
|
||||
<Box>
|
||||
{!joining ? (
|
||||
<Text color="blue">Invited</Text>
|
||||
) : joining === 'no-perms' || joining == 'strange' ? (
|
||||
<Text color="red">Join Failed</Text>
|
||||
) : joining !== "done" ? (
|
||||
<Text gray>Joining...</Text>
|
||||
) : (
|
||||
|
@ -150,22 +150,38 @@ function JoinError(props: {
|
||||
desc: JoinDesc;
|
||||
request: JoinRequest;
|
||||
modal: boolean;
|
||||
dismiss: () => void;
|
||||
}) {
|
||||
const { desc, request, modal } = props;
|
||||
const { dismiss, desc, request, modal } = props;
|
||||
const { preview } = usePreview(desc.group);
|
||||
const group = preview?.metadata?.title ?? desc.group;
|
||||
const title = `Joining ${group} failed`;
|
||||
const explanation =
|
||||
request.progress === 'no-perms'
|
||||
? 'You do not have the correct permissions'
|
||||
: 'An unexpected error occurred';
|
||||
: 'An unexpected error occurred';
|
||||
|
||||
const onRetry = () => {
|
||||
useGroupState.getState().abortJoin(desc.group);
|
||||
const [,,ship,name] = group.split('/');
|
||||
airlock.poke(
|
||||
join(ship, name, desc.kind, false, false)
|
||||
);
|
||||
};
|
||||
|
||||
const onAbort = () => {
|
||||
useGroupState.getState().abortJoin(desc.group);
|
||||
dismiss();
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<JoinSkeleton modal={modal} title={title} desc={desc}>
|
||||
<Col p='4' gapY='4'>
|
||||
<Text fontWeight='medium'>{explanation}</Text>
|
||||
<Row>
|
||||
<Button>Dismiss</Button>
|
||||
<Row gapX="2">
|
||||
<Button onClick={onRetry} primary>Retry</Button>
|
||||
<Button onClick={onAbort} destructive>Abort</Button>
|
||||
</Row>
|
||||
</Col>
|
||||
</JoinSkeleton>
|
||||
@ -233,7 +249,7 @@ export function Join(props: JoinProps) {
|
||||
finished={finishedPath}
|
||||
/>
|
||||
) : isErrored ? (
|
||||
<JoinError modal={modal} desc={desc} request={openedRequest} />
|
||||
<JoinError dismiss={dismiss} modal={modal} desc={desc} request={openedRequest} />
|
||||
) : (
|
||||
<JoinInitial modal={modal} dismiss={dismiss} desc={desc} invite={invite} />
|
||||
);
|
||||
|
@ -295,12 +295,14 @@
|
||||
::
|
||||
++ rollback
|
||||
|^
|
||||
=/ =request:view (~(got by joining) rid)
|
||||
=/ =request:view (~(got by joining) rid)
|
||||
?+ progress.request ~|(cannot-rollback/progress.request !!)
|
||||
%start start
|
||||
%added added
|
||||
%metadata metadata
|
||||
%start start
|
||||
%added added
|
||||
%metadata metadata
|
||||
?(%no-perms %strange %abort) error
|
||||
==
|
||||
++ error jn-core
|
||||
++ start jn-core
|
||||
++ added (emit del-us:pass)
|
||||
++ metadata (emit:added remove-pull-groups:pass)
|
||||
|
Loading…
Reference in New Issue
Block a user