@flamingo-stack/openframe-frontend-core 0.0.217-snapshot.20260601003634 → 0.0.217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/tickets/hooks/use-ticket-engagements.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +2 -16
- package/dist/components/tickets/index.cjs.map +1 -1
- package/dist/components/tickets/index.js +2 -16
- package/dist/components/tickets/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/tickets/hooks/use-ticket-engagements.ts +4 -24
|
@@ -237,8 +237,7 @@ var LIST_ENGAGEMENTS_ENDPOINT = "/api/chat/agent/list-engagements";
|
|
|
237
237
|
function useTicketEngagements(externalTicketId, enabled = true, refetchInterval = false) {
|
|
238
238
|
const identity = useChatIdentity();
|
|
239
239
|
const identityKey = identity.user?.email ?? "anon";
|
|
240
|
-
const
|
|
241
|
-
const queryEnabled = fetchable && identity.authTier !== "anon" && !!identity.user?.email;
|
|
240
|
+
const queryEnabled = enabled && identity.authTier !== "anon" && !!identity.user?.email && !!externalTicketId && !externalTicketId.startsWith("temp-");
|
|
242
241
|
const query = useQuery({
|
|
243
242
|
queryKey: ["ticket-engagements", externalTicketId, identityKey],
|
|
244
243
|
enabled: queryEnabled,
|
|
@@ -269,20 +268,7 @@ function useTicketEngagements(externalTicketId, enabled = true, refetchInterval
|
|
|
269
268
|
});
|
|
270
269
|
return {
|
|
271
270
|
engagements: query.data ?? [],
|
|
272
|
-
|
|
273
|
-
// double-flash. The bug: `useChatIdentity` starts at anon defaults and
|
|
274
|
-
// resolves async, so on the first render `queryEnabled` is false and the
|
|
275
|
-
// OLD `queryEnabled && query.isLoading` returned FALSE — the panel rendered
|
|
276
|
-
// the ticket body, THEN identity resolved, the query enabled, isLoading
|
|
277
|
-
// flipped true → skeleton appeared (the blink), then data landed.
|
|
278
|
-
//
|
|
279
|
-
// Fix: for a fetchable ticket we are "loading" whenever we don't yet have
|
|
280
|
-
// the timeline to show — that includes the window while identity is still
|
|
281
|
-
// resolving (so we skeleton from the FIRST render, never the body) AND the
|
|
282
|
-
// cold query fetch (`data === undefined`). A background poll keeps
|
|
283
|
-
// `query.data` defined, so it never re-flashes the skeleton. Non-fetchable
|
|
284
|
-
// (optimistic/disabled) or a resolved-anon viewer → not loading.
|
|
285
|
-
isLoading: fetchable && (identity.isLoading || queryEnabled && query.data === void 0),
|
|
271
|
+
isLoading: queryEnabled && query.isLoading,
|
|
286
272
|
isFetching: query.isFetching,
|
|
287
273
|
error: query.error ?? null,
|
|
288
274
|
refetch: () => {
|