From 9fae693cb305097d0954134f2495a008cfe024bb Mon Sep 17 00:00:00 2001 From: Marcos Reifonas Date: Thu, 13 Aug 2026 21:22:29 +0000 Subject: [PATCH] fix(lint): tipagem estrita de Error em hook Auth e sync timeout de catch --- src/hooks/useAuth.tsx | 6 +++--- src/hooks/useSessionLogs.tsx | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hooks/useAuth.tsx b/src/hooks/useAuth.tsx index e939cf1..1126282 100644 --- a/src/hooks/useAuth.tsx +++ b/src/hooks/useAuth.tsx @@ -7,10 +7,10 @@ interface AuthContextType { user: User | null; session: Session | null; loading: boolean; - signIn: (email: string, password: string) => Promise<{ error: any }>; - signUp: (email: string, password: string) => Promise<{ error: any }>; + signIn: (email: string, password: string) => Promise<{ error: unknown }>; + signUp: (email: string, password: string) => Promise<{ error: unknown }>; signOut: () => Promise; - updatePassword: (password: string) => Promise<{ error: any }>; + updatePassword: (password: string) => Promise<{ error: unknown }>; isRecoveryFlow: boolean; } diff --git a/src/hooks/useSessionLogs.tsx b/src/hooks/useSessionLogs.tsx index e645329..a9efa29 100644 --- a/src/hooks/useSessionLogs.tsx +++ b/src/hooks/useSessionLogs.tsx @@ -309,7 +309,9 @@ export const useSessionLogs = () => { .from('user_session_logs') .update({ updated_at: new Date().toISOString() }) .eq('id', sessionId) - .catch(console.error); + .then(({ error }) => { + if (error) console.error('Heartbeat error:', error); + }); } }, 30000); // Atualizar a cada 30 segundos return () => clearInterval(interval);