[WEB-1691] chore: refactor finish onboarding logic to avoid multiple redirections. (#4950)
* [WEB-1691] chore: refactor finsh onboarding logic to avoid multiple redirections. * fix: infinite redirection on visiting onboarding page when the user is not authenticated. * chore: update intercepter redirect logic.
This commit is contained in:
parent
1f9f821543
commit
ff4de9ac11
6 changed files with 91 additions and 88 deletions
|
|
@ -14,7 +14,7 @@ import { ROLE } from "@/constants/workspace";
|
|||
import { truncateText } from "@/helpers/string.helper";
|
||||
import { getUserRole } from "@/helpers/user.helper";
|
||||
// hooks
|
||||
import { useEventTracker, useWorkspace } from "@/hooks/store";
|
||||
import { useEventTracker, useUserSettings, useWorkspace } from "@/hooks/store";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
|
||||
|
|
@ -32,6 +32,7 @@ export const Invitations: React.FC<Props> = (props) => {
|
|||
// store hooks
|
||||
const { captureEvent } = useEventTracker();
|
||||
const { fetchWorkspaces } = useWorkspace();
|
||||
const { fetchCurrentUserSettings } = useUserSettings();
|
||||
|
||||
const { data: invitations } = useSWR(USER_WORKSPACE_INVITATIONS, () => workspaceService.userWorkspaceInvitations());
|
||||
|
||||
|
|
@ -61,6 +62,7 @@ export const Invitations: React.FC<Props> = (props) => {
|
|||
element: "Workspace invitations page",
|
||||
});
|
||||
await fetchWorkspaces();
|
||||
await fetchCurrentUserSettings();
|
||||
await handleNextStep();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue