frontend permissions

* rework backend workspace permissions
This commit is contained in:
Philipinho
2024-06-03 02:54:12 +01:00
parent b88e0b605f
commit 886d9591fa
54 changed files with 715 additions and 385 deletions

View File

@ -8,15 +8,16 @@ export function UserProvider({ children }: React.PropsWithChildren) {
const { data, isLoading, error } = useCurrentUser();
useEffect(() => {
if (data && data.user) {
if (data && data.user && data.workspace) {
setCurrentUser(data);
}
}, [data, isLoading, setCurrentUser]);
}, [data, isLoading]);
if (isLoading) return <></>;
if (!data.user && !data.workspace) return <></>;
if (error) {
console.error(error);
return <>an error occurred</>;
}