Skip to content

Commit 9fb54f9

Browse files
authored
fix existing user invite bug (#1457)
1 parent 947ccf8 commit 9fb54f9

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

www/src/components/Invite.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ import isEmpty from 'lodash/isEmpty'
2222
import { GqlError } from './utils/Alert'
2323

2424
function ExistingInvite({
25-
invite: { id, account, user },
25+
inviteId,
26+
invite: { account, user },
2627
}: {
28+
inviteId: string
2729
invite: InviteFragment
2830
}) {
2931
const [mutation, { loading, error }] = useRealizeInviteMutation({
30-
variables: { id },
32+
variables: { id: inviteId },
3133
onCompleted: ({ realizeInvite }) => {
3234
setToken(realizeInvite?.jwt)
3335
;(window as Window).location = '/'
@@ -109,7 +111,7 @@ export default function Invite() {
109111
</Flex>
110112
)
111113

112-
if (!invite)
114+
if (!invite || !inviteId)
113115
return (
114116
<Flex
115117
grow={1}
@@ -125,7 +127,13 @@ export default function Invite() {
125127
confirm
126128
)
127129

128-
if (invite.user) return <ExistingInvite invite={invite} />
130+
if (invite.user)
131+
return (
132+
<ExistingInvite
133+
inviteId={inviteId}
134+
invite={invite}
135+
/>
136+
)
129137

130138
const submitEnabled = !isEmpty(name) && !passwordDisabled
131139
const onSubmit = (e) => {

0 commit comments

Comments
 (0)