forked from github/plane
Merge pull request #8 from makeplane/stage-release
dev: promote to production
This commit is contained in:
commit
d2cc452de8
@ -131,7 +131,7 @@ export const UserProvider = ({ children }: { children: ReactElement }) => {
|
|||||||
<UserContext.Provider
|
<UserContext.Provider
|
||||||
value={{
|
value={{
|
||||||
user: error ? undefined : data,
|
user: error ? undefined : data,
|
||||||
isUserLoading: !(!!data || !!error),
|
isUserLoading: Boolean(data === undefined && error === undefined),
|
||||||
mutateUser: mutate,
|
mutateUser: mutate,
|
||||||
activeWorkspace: workspaceError ? undefined : activeWorkspace,
|
activeWorkspace: workspaceError ? undefined : activeWorkspace,
|
||||||
mutateWorkspaces: mutateWorkspaces,
|
mutateWorkspaces: mutateWorkspaces,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "trello-clone",
|
"name": "plane",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -10,7 +10,9 @@ const Home: NextPage = () => {
|
|||||||
|
|
||||||
const { user, isUserLoading, activeWorkspace, workspaces } = useUser();
|
const { user, isUserLoading, activeWorkspace, workspaces } = useUser();
|
||||||
|
|
||||||
if (!isUserLoading && !user) router.push("/signin");
|
useEffect(() => {
|
||||||
|
if (!isUserLoading && (!user || user === null)) router.push("/signin");
|
||||||
|
}, [isUserLoading, user, router]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!activeWorkspace && workspaces?.length === 0) router.push("/invitations");
|
if (!activeWorkspace && workspaces?.length === 0) router.push("/invitations");
|
||||||
|
Loading…
Reference in New Issue
Block a user