feat: group all-account rows by instrument and day (WealthLedger/main#47) (#126)
This commit was merged in pull request #126.
This commit is contained in:
@@ -33,6 +33,7 @@ type AccountPageRecentOperations
|
||||
stale?: boolean;
|
||||
state: "loaded" | "partial";
|
||||
to: string;
|
||||
totalVisible?: boolean;
|
||||
}
|
||||
| {
|
||||
state: "empty"
|
||||
@@ -84,6 +85,7 @@ function toRecentEvents(
|
||||
items: events.data?.events.slice(0, RECENT_EVENTS_LIMIT) ?? [],
|
||||
state: "partial",
|
||||
to,
|
||||
totalVisible: false,
|
||||
};
|
||||
if (!events.data && (events.isError || events.meta?.lastAttempt.state === "failed"))
|
||||
return { state: "error", to };
|
||||
@@ -94,6 +96,7 @@ function toRecentEvents(
|
||||
items,
|
||||
state: "loaded",
|
||||
to,
|
||||
totalVisible: events.meta?.completeness === "complete",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -109,7 +112,12 @@ function toRecentOperations(
|
||||
)
|
||||
return { state: "loading", to };
|
||||
if (operations.meta?.completeness === "incomplete")
|
||||
return { items: operations.data?.items ?? [], state: "partial", to };
|
||||
return {
|
||||
items: operations.data?.items ?? [],
|
||||
state: "partial",
|
||||
to,
|
||||
totalVisible: false,
|
||||
};
|
||||
if (
|
||||
!operations.data
|
||||
&& (operations.isError || operations.meta?.lastAttempt.state === "failed")
|
||||
@@ -125,6 +133,7 @@ function toRecentOperations(
|
||||
stale: operations.meta?.freshness === "stale",
|
||||
state: "loaded",
|
||||
to,
|
||||
totalVisible: operations.meta?.completeness === "complete",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user