diff --git a/apps/desktop/src/main.tsx b/apps/desktop/src/main.tsx index 7e038aa..902da12 100644 --- a/apps/desktop/src/main.tsx +++ b/apps/desktop/src/main.tsx @@ -1206,7 +1206,10 @@ useEffect(() => { openSystem() }, [token, status, config?.accessRole, openSystem, tokenValidationTick]) - if (isLaunchingSystem && token) { + // Quando há token persistido (dispositivo já provisionado) e ainda não + // disparamos o auto-launch, exibimos diretamente a tela de loading da + // plataforma para evitar piscar o card de resumo/inventário. + if ((token && !autoLaunchRef.current) || (isLaunchingSystem && token)) { return (
diff --git a/src/components/portal/portal-ticket-list.tsx b/src/components/portal/portal-ticket-list.tsx index 40fead1..cd8f3de 100644 --- a/src/components/portal/portal-ticket-list.tsx +++ b/src/components/portal/portal-ticket-list.tsx @@ -21,7 +21,7 @@ import { } from "@/components/portal/portal-ticket-filters" export function PortalTicketList() { - const { convexUserId, session, machineContext, role } = useAuth() + const { convexUserId, session, machineContext, role, isLoading: authLoading, machineContextLoading } = useAuth() const viewerId = (convexUserId ?? machineContext?.assignedUserId ?? null) as Id<"users"> | null @@ -145,7 +145,7 @@ export function PortalTicketList() { setFilters(defaultPortalTicketFilters) } - const isLoading = Boolean(viewerId && ticketsRaw === undefined) + const isLoading = Boolean(authLoading || machineContextLoading || (viewerId && ticketsRaw === undefined)) if (isLoading) { return (