Update company card (#512)
* Add card rows * WIP - add amount * Refactor board state to separate pipeline progress data and company data * Add migration and generated code * Pass pipeline progress properties to the comapny card * WIP-editable * Enable amount edition * Nits * Remove useless import * Fix empty board bug * Use cell for editable values on company card * Add fields * Enable edition for closeDate * Add dummy edits for recurring and probability * Nits * remove useless fields * Nits * Fix user provider * Add generated code * Fix nits, reorder migrations, fix login * Fix tests * Fix lint
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { useIsLogged } from '@/auth/hooks/useIsLogged';
|
||||
import { currentUserState } from '@/auth/states/currentUserState';
|
||||
import { useGetCurrentUserQuery } from '~/generated/graphql';
|
||||
|
||||
export function UserProvider({ children }: React.PropsWithChildren) {
|
||||
const [, setCurrentUser] = useRecoilState(currentUserState);
|
||||
const [currentUser, setCurrentUser] = useRecoilState(currentUserState);
|
||||
const isLoggedIn = useIsLogged();
|
||||
const { data, loading } = useGetCurrentUserQuery();
|
||||
|
||||
useEffect(() => {
|
||||
@ -14,5 +16,5 @@ export function UserProvider({ children }: React.PropsWithChildren) {
|
||||
}
|
||||
}, [setCurrentUser, data]);
|
||||
|
||||
return loading ? <></> : <>{children}</>;
|
||||
return loading || (isLoggedIn && !currentUser) ? <></> : <>{children}</>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user