feat: decode activity SSE events and expose tracker total
This commit is contained in:
@@ -8,6 +8,12 @@ export function decodeEvent(msg: SseMessage): FeedEvent | null {
|
||||
if (!outer.data) return null;
|
||||
const inner = JSON.parse(outer.data) as Record<string, unknown>;
|
||||
|
||||
if (outer.type === "activity") {
|
||||
const id = typeof inner.id === "number" ? inner.id : Number.NaN;
|
||||
if (Number.isFinite(id)) return { type: "activity", id };
|
||||
return null;
|
||||
}
|
||||
|
||||
if (outer.type === "inflight") {
|
||||
const operation = inner.operation as string;
|
||||
if (operation === "remove") {
|
||||
|
||||
Reference in New Issue
Block a user