mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
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 {
|
const {
|
||||||
workspace: { fetchWorkspaceMembers },
|
workspace: { fetchWorkspaceMembers },
|
||||||
} = useMember();
|
} = useMember();
|
||||||
const { workspaces, loader } = useWorkspace();
|
const { workspaces } = useWorkspace();
|
||||||
const { isMobile } = usePlatformOS();
|
const { isMobile } = usePlatformOS();
|
||||||
|
|
||||||
const planeLogo = resolvedTheme === "dark" ? PlaneWhiteLogo : PlaneBlackLogo;
|
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 list of workspaces are not there then we have to render the spinner
|
||||||
if (allWorkspaces === undefined || loader) {
|
if (allWorkspaces === undefined) {
|
||||||
return (
|
return (
|
||||||
<div className="grid h-screen place-items-center bg-custom-background-100 p-4">
|
<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">
|
<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 { ROLE } from "@/constants/workspace";
|
||||||
import { truncateText } from "@/helpers/string.helper";
|
import { truncateText } from "@/helpers/string.helper";
|
||||||
import { getUserRole } from "@/helpers/user.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 { UserAuthWrapper } from "@/layouts/auth-layout";
|
||||||
import DefaultLayout from "@/layouts/default-layout";
|
import DefaultLayout from "@/layouts/default-layout";
|
||||||
import { NextPageWithLayout } from "@/lib/types";
|
import { NextPageWithLayout } from "@/lib/types";
|
||||||
@ -43,6 +43,7 @@ const UserInvitationsPage: NextPageWithLayout = observer(() => {
|
|||||||
// store hooks
|
// store hooks
|
||||||
const { captureEvent, joinWorkspaceMetricGroup } = useEventTracker();
|
const { captureEvent, joinWorkspaceMetricGroup } = useEventTracker();
|
||||||
const { currentUser, currentUserSettings } = useUser();
|
const { currentUser, currentUserSettings } = useUser();
|
||||||
|
const { fetchWorkspaces } = useWorkspace();
|
||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// next-themes
|
// next-themes
|
||||||
@ -96,7 +97,9 @@ const UserInvitationsPage: NextPageWithLayout = observer(() => {
|
|||||||
.updateUser({ last_workspace_id: redirectWorkspace?.id })
|
.updateUser({ last_workspace_id: redirectWorkspace?.id })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
setIsJoiningWorkspaces(false);
|
setIsJoiningWorkspaces(false);
|
||||||
router.push(`/${redirectWorkspace?.slug}`);
|
fetchWorkspaces().then(() => {
|
||||||
|
router.push(`/${redirectWorkspace?.slug}`);
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
setToast({
|
setToast({
|
||||||
|
Loading…
Reference in New Issue
Block a user