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:
@@ -18,6 +18,7 @@ import {
|
||||
|
||||
type AccountEventsPageViewModel
|
||||
= | {
|
||||
allAccounts: boolean;
|
||||
canApply: boolean;
|
||||
draftPeriod: [null | string, null | string];
|
||||
events: BrokerageEvent[];
|
||||
@@ -29,6 +30,7 @@ type AccountEventsPageViewModel
|
||||
partial?: boolean;
|
||||
source?: InvestmentResourceMeta;
|
||||
state: "loaded";
|
||||
totalVisible: boolean;
|
||||
}
|
||||
| { onReset: () => void; state: "error" }
|
||||
| { state: "loading" };
|
||||
@@ -100,6 +102,7 @@ function useAccountEventsPageViewModel(): AccountEventsPageViewModel {
|
||||
: { state: "loading" };
|
||||
|
||||
return {
|
||||
allAccounts: accountId === "all",
|
||||
canApply:
|
||||
(draftFrom !== appliedFrom || draftTo !== appliedTo)
|
||||
&& isValidPeriod(draftFrom, draftTo),
|
||||
@@ -121,6 +124,7 @@ function useAccountEventsPageViewModel(): AccountEventsPageViewModel {
|
||||
partial: events.meta?.completeness === "incomplete",
|
||||
source: events.meta,
|
||||
state: "loaded",
|
||||
totalVisible: events.meta?.completeness === "complete",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user