From 745f8de40ec48dd181396838c61b3a318549d526 Mon Sep 17 00:00:00 2001 From: Lucas Santana Date: Tue, 31 Dec 2024 07:05:36 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20implementa=20sistema=20de=20dele=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20hist=C3=B3rias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adiciona modal de confirmação de deleção - Implementa limpeza em cascata de recursos - Otimiza remoção de arquivos no storage - Adiciona feedback visual do processo - Melhora tratamento de erros - Implementa navegação pós-deleção --- src/components/auth/ProtectedRoute.tsx | 4 ---- src/pages/student-dashboard/StoryPage.tsx | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/auth/ProtectedRoute.tsx b/src/components/auth/ProtectedRoute.tsx index 3493b6a..dfa133e 100644 --- a/src/components/auth/ProtectedRoute.tsx +++ b/src/components/auth/ProtectedRoute.tsx @@ -13,9 +13,6 @@ export function ProtectedRoute({ children, allowedRoles = [] }: ProtectedRoutePr const { user, loading, userRole } = useAuth(); const location = useLocation(); - console.log('ProtectedRoute - User:', user?.user_metadata); - console.log('ProtectedRoute - UserRole do contexto:', userRole); - console.log('ProtectedRoute - Roles permitidas:', allowedRoles); if (loading) { return
Carregando...
; @@ -28,7 +25,6 @@ export function ProtectedRoute({ children, allowedRoles = [] }: ProtectedRoutePr // Pegar o role diretamente dos metadados do usuário const currentRole = user.user_metadata?.role; - console.log('ProtectedRoute - Role dos metadados:', currentRole); // Se não houver roles requeridas, permite acesso if (allowedRoles.length === 0) { diff --git a/src/pages/student-dashboard/StoryPage.tsx b/src/pages/student-dashboard/StoryPage.tsx index c1fef79..2233933 100644 --- a/src/pages/student-dashboard/StoryPage.tsx +++ b/src/pages/student-dashboard/StoryPage.tsx @@ -450,8 +450,7 @@ export function StoryPage() { if (error) throw error; - // Log para debug - console.log('Recordings fetched:', data); + if (data && data.length > 0) { setRecordings(data);