chore: email invite accept validation (#2965)
* fix: empty state flickering on accepting only invitation * fix: redirection from workspace-invitaion to onboarding * chore: onboarding step 1 skip on accepting invite from email * fix: dashboard redirection path
This commit is contained in:
parent
de9c1a60e0
commit
dbc8150852
3 changed files with 19 additions and 2 deletions
|
|
@ -52,6 +52,10 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
|
|||
},
|
||||
});
|
||||
|
||||
useSWR(`USER_WORKSPACES_LIST`, () => workspaceStore.fetchWorkspaces(), {
|
||||
shouldRetryOnError: false,
|
||||
});
|
||||
|
||||
const { data: invitations } = useSWR("USER_WORKSPACE_INVITATIONS_LIST", () =>
|
||||
workspaceService.userWorkspaceInvitations()
|
||||
);
|
||||
|
|
@ -88,6 +92,19 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
|
|||
|
||||
const onboardingStep = user.onboarding_step;
|
||||
|
||||
if (!onboardingStep.workspace_join && !onboardingStep.workspace_create && workspaces && workspaces?.length > 0) {
|
||||
await updateCurrentUser({
|
||||
onboarding_step: {
|
||||
...user.onboarding_step,
|
||||
workspace_join: true,
|
||||
workspace_create: true,
|
||||
},
|
||||
last_workspace_id: workspaces[0].id,
|
||||
});
|
||||
setStep(2);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!onboardingStep.workspace_join && !onboardingStep.workspace_create && step !== 1) setStep(1);
|
||||
|
||||
if (onboardingStep.workspace_join || onboardingStep.workspace_create) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue