Solución del login colgado
Some checks failed
/ Deploy to Cloudflare Pages (push) Has been cancelled
Some checks failed
/ Deploy to Cloudflare Pages (push) Has been cancelled
This commit is contained in:
@@ -724,8 +724,9 @@ export function LibraryPage() {
|
||||
const { message: toastMessage, show: showToast } = useToast()
|
||||
|
||||
useEffect(() => {
|
||||
if (!user) return // no fetchear hasta tener usuario confirmado (evita race condition con sesión Supabase)
|
||||
load()
|
||||
}, [load])
|
||||
}, [load, user])
|
||||
|
||||
function navigateToGroup(groupId: string | null) {
|
||||
setTransitioning(true)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { supabase } from '@/lib/supabase'
|
||||
import { supabaseActivityRepo } from '@/persistence/supabase/activity-repo'
|
||||
import { supabaseResourceRepo } from '@/persistence/supabase/resource-repo'
|
||||
import { supabaseProcessRepo } from '@/persistence/supabase/process-repo'
|
||||
@@ -29,6 +30,8 @@ export function useReportData(processId: string): ReportData {
|
||||
setIsLoading(true)
|
||||
setError(null)
|
||||
try {
|
||||
// Barrera única: garantiza sesión restaurada antes del fan-out en paralelo
|
||||
await supabase.auth.getSession()
|
||||
const [proc, sim, acts, res] = await Promise.all([
|
||||
supabaseProcessRepo.getById(processId),
|
||||
supabaseSimulationRepo.getLatestByProcess(processId),
|
||||
|
||||
Reference in New Issue
Block a user