diff --git a/space/app/loading.tsx b/space/app/loading.tsx deleted file mode 100644 index d35e42a767f..00000000000 --- a/space/app/loading.tsx +++ /dev/null @@ -1,20 +0,0 @@ -"use client"; -import Image from "next/image"; -import { useTheme } from "next-themes"; -// assets -import LogoSpinnerDark from "@/public/images/logo-spinner-dark.gif"; -import LogoSpinnerLight from "@/public/images/logo-spinner-light.gif"; - -export default function LogoSpinner() { - const { resolvedTheme } = useTheme(); - - const logoSrc = resolvedTheme === "dark" ? LogoSpinnerDark : LogoSpinnerLight; - - return ( -
-
- logo -
-
- ); -} diff --git a/space/app/page.tsx b/space/app/page.tsx index d03300a2540..a6058fb8a37 100644 --- a/space/app/page.tsx +++ b/space/app/page.tsx @@ -1,5 +1,6 @@ "use client"; +import { observer } from "mobx-react-lite"; // components import { UserLoggedIn } from "@/components/account"; import { LogoSpinner } from "@/components/common"; @@ -7,7 +8,7 @@ import { AuthView } from "@/components/views"; // hooks import { useUser } from "@/hooks/store"; -export default function HomePage() { +const HomePage = observer(() => { const { data: currentUser, isAuthenticated, isLoading } = useUser(); if (isLoading) return ; @@ -15,4 +16,6 @@ export default function HomePage() { if (currentUser && isAuthenticated) return ; return ; -} +}); + +export default HomePage; diff --git a/space/components/views/auth.tsx b/space/components/views/auth.tsx index 88023dbef31..5992ca5a5de 100644 --- a/space/components/views/auth.tsx +++ b/space/components/views/auth.tsx @@ -37,7 +37,7 @@ export const AuthView = observer(() => { -
+
diff --git a/space/helpers/authentication.helper.tsx b/space/helpers/authentication.helper.tsx index e2be3c61775..0e5ab01861a 100644 --- a/space/helpers/authentication.helper.tsx +++ b/space/helpers/authentication.helper.tsx @@ -1,5 +1,7 @@ import { ReactNode } from "react"; import Link from "next/link"; +// helpers +import { SUPPORT_EMAIL } from "./common.helper"; export enum EPageTypes { INIT = "INIT", @@ -152,7 +154,7 @@ const errorCodeMessages: { // sign in [EAuthenticationErrorCodes.USER_ACCOUNT_DEACTIVATED]: { title: `User account deactivated`, - message: () =>
Your account is deactivated. Contact support@plane.so.
, + message: () => `User account deactivated. Please contact ${!!SUPPORT_EMAIL ? SUPPORT_EMAIL : "administrator"}.`, }, [EAuthenticationErrorCodes.USER_DOES_NOT_EXIST]: { diff --git a/space/helpers/common.helper.ts b/space/helpers/common.helper.ts index 52c61e4e209..6db73a4a100 100644 --- a/space/helpers/common.helper.ts +++ b/space/helpers/common.helper.ts @@ -8,6 +8,8 @@ export const ADMIN_BASE_PATH = process.env.NEXT_PUBLIC_ADMIN_BASE_PATH || ""; export const SPACE_BASE_PATH = process.env.NEXT_PUBLIC_SPACE_BASE_PATH || ""; +export const SUPPORT_EMAIL = process.env.NEXT_PUBLIC_SUPPORT_EMAIL || ""; + export const WEB_BASE_URL = process.env.NEXT_PUBLIC_WEB_BASE_URL || ""; export const GOD_MODE_URL = encodeURI(`${ADMIN_BASE_URL}${ADMIN_BASE_PATH}`); diff --git a/space/lib/instance-provider.tsx b/space/lib/instance-provider.tsx index a4de61a1619..db9b15db7a9 100644 --- a/space/lib/instance-provider.tsx +++ b/space/lib/instance-provider.tsx @@ -31,7 +31,11 @@ export const InstanceProvider = observer(({ children }: { children: ReactNode }) revalidateIfStale: false, errorRetryCount: 0, }); - useSWR("CURRENT_USER", () => fetchCurrentUser()); + useSWR("CURRENT_USER", () => fetchCurrentUser(), { + shouldRetryOnError: false, + revalidateOnFocus: false, + revalidateIfStale: false, + }); if (!instance && !error) return (