cache middleware
This commit is contained in:
@@ -47,7 +47,7 @@ export async function loader({ context, request }: Route.ActionArgs) {
|
||||
return {
|
||||
user,
|
||||
sidebar_state,
|
||||
...workspace
|
||||
workspace
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export function shouldRevalidate({
|
||||
}
|
||||
|
||||
export default function Route({ loaderData }: Route.ComponentProps) {
|
||||
const { user, sidebar_state, blocked, ...props } = loaderData
|
||||
const { user, sidebar_state, workspace } = loaderData
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== 'undefined' && window.rybbit) {
|
||||
@@ -73,7 +73,7 @@ export default function Route({ loaderData }: Route.ComponentProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
{blocked ? (
|
||||
{workspace.blocked ? (
|
||||
<AlertDialog open={true}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogTitle>Serviço com acesso suspenso</AlertDialogTitle>
|
||||
@@ -85,10 +85,10 @@ export default function Route({ loaderData }: Route.ComponentProps) {
|
||||
</AlertDialog>
|
||||
) : null}
|
||||
|
||||
<WorkspaceProvider {...props}>
|
||||
<WorkspaceProvider {...workspace}>
|
||||
<SidebarProvider
|
||||
defaultOpen={sidebar_state === 'true'}
|
||||
className={cn('flex', blocked && 'pointer-events-none')}
|
||||
className={cn('flex', workspace.blocked && 'pointer-events-none')}
|
||||
>
|
||||
<AppSidebar />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user