forked from github/plane
chore: workspace invite loader improvement (#4152)
This commit is contained in:
parent
699017014e
commit
f805acbcef
@ -32,7 +32,7 @@ export const WorkspaceAuthWrapper: FC<IWorkspaceAuthWrapper> = observer((props)
|
||||
const {
|
||||
workspace: { fetchWorkspaceMembers },
|
||||
} = useMember();
|
||||
const { workspaces, loader } = useWorkspace();
|
||||
const { workspaces } = useWorkspace();
|
||||
const { isMobile } = usePlatformOS();
|
||||
|
||||
const planeLogo = resolvedTheme === "dark" ? PlaneWhiteLogo : PlaneBlackLogo;
|
||||
@ -84,7 +84,7 @@ export const WorkspaceAuthWrapper: FC<IWorkspaceAuthWrapper> = observer((props)
|
||||
};
|
||||
|
||||
// if list of workspaces are not there then we have to render the spinner
|
||||
if (allWorkspaces === undefined || loader) {
|
||||
if (allWorkspaces === undefined) {
|
||||
return (
|
||||
<div className="grid h-screen place-items-center bg-custom-background-100 p-4">
|
||||
<div className="flex flex-col items-center gap-3 text-center">
|
||||
|
@ -15,7 +15,7 @@ import { MEMBER_ACCEPTED } from "@/constants/event-tracker";
|
||||
import { ROLE } from "@/constants/workspace";
|
||||
import { truncateText } from "@/helpers/string.helper";
|
||||
import { getUserRole } from "@/helpers/user.helper";
|
||||
import { useEventTracker, useUser } from "@/hooks/store";
|
||||
import { useEventTracker, useUser, useWorkspace } from "@/hooks/store";
|
||||
import { UserAuthWrapper } from "@/layouts/auth-layout";
|
||||
import DefaultLayout from "@/layouts/default-layout";
|
||||
import { NextPageWithLayout } from "@/lib/types";
|
||||
@ -43,6 +43,7 @@ const UserInvitationsPage: NextPageWithLayout = observer(() => {
|
||||
// store hooks
|
||||
const { captureEvent, joinWorkspaceMetricGroup } = useEventTracker();
|
||||
const { currentUser, currentUserSettings } = useUser();
|
||||
const { fetchWorkspaces } = useWorkspace();
|
||||
// router
|
||||
const router = useRouter();
|
||||
// next-themes
|
||||
@ -96,7 +97,9 @@ const UserInvitationsPage: NextPageWithLayout = observer(() => {
|
||||
.updateUser({ last_workspace_id: redirectWorkspace?.id })
|
||||
.then(() => {
|
||||
setIsJoiningWorkspaces(false);
|
||||
router.push(`/${redirectWorkspace?.slug}`);
|
||||
fetchWorkspaces().then(() => {
|
||||
router.push(`/${redirectWorkspace?.slug}`);
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
setToast({
|
||||
|
Loading…
Reference in New Issue
Block a user