cache middleware

This commit is contained in:
2026-01-27 13:45:10 -03:00
parent 9ad9457260
commit 028297443a
2 changed files with 61 additions and 13 deletions

View File

@@ -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 />