fix(portal,lint):\n- Move useMemo para antes de returns na lista do portal (regras de hooks)\n- Remove usos de any na overview de dispositivos
This commit is contained in:
parent
c2c5707a97
commit
1e45324460
2 changed files with 8 additions and 8 deletions
|
|
@ -3415,7 +3415,7 @@ export function DeviceDetails({ device }: DeviceDetailsProps) {
|
|||
}, [device?.customFields])
|
||||
|
||||
const editableFields = useMemo(
|
||||
() => (deviceFieldDefs ?? []).map((f) => ({ id: f.id, key: f.key, label: f.label, type: (f as any).type ?? "text", options: (f as any).options ?? [] })),
|
||||
() => (deviceFieldDefs ?? []).map((f) => ({ id: f.id, key: f.key, label: f.label, type: f.type ?? "text", options: f.options ?? [] })),
|
||||
[deviceFieldDefs]
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,13 @@ export function PortalTicketList() {
|
|||
return mapTicketsFromServerList((ticketsRaw as unknown[]) ?? [])
|
||||
}, [ticketsRaw])
|
||||
|
||||
const lastResolvedNoCsat = useMemo(() => {
|
||||
const resolved = (tickets as Ticket[])
|
||||
.filter((t) => t.status === "RESOLVED" && (t.csatScore == null))
|
||||
.sort((a, b) => (b.resolvedAt?.getTime?.() ?? 0) - (a.resolvedAt?.getTime?.() ?? 0))
|
||||
return resolved[0] ?? null
|
||||
}, [tickets])
|
||||
|
||||
const isLoading = Boolean(viewerId && ticketsRaw === undefined)
|
||||
|
||||
if (isLoading) {
|
||||
|
|
@ -84,13 +91,6 @@ export function PortalTicketList() {
|
|||
)
|
||||
}
|
||||
|
||||
const lastResolvedNoCsat = useMemo(() => {
|
||||
const resolved = (tickets as Ticket[])
|
||||
.filter((t) => t.status === "RESOLVED" && (t.csatScore == null))
|
||||
.sort((a, b) => (b.resolvedAt?.getTime?.() ?? 0) - (a.resolvedAt?.getTime?.() ?? 0))
|
||||
return resolved[0] ?? null
|
||||
}, [tickets])
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue