ux: evitar estados intermediarios incorretos no portal e desktop

This commit is contained in:
Esdras Renan 2025-11-14 11:43:09 -03:00
parent 61d3573830
commit 3ee072854f
2 changed files with 6 additions and 3 deletions

View file

@ -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 (
<div className="min-h-screen grid place-items-center bg-slate-50 p-6">
<div className="flex flex-col items-center gap-3 rounded-2xl border border-slate-200 bg-white px-8 py-10 shadow-sm">

View file

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