Quick resolve account types
This commit is contained in:
@@ -163,6 +163,24 @@ export function resolveFirmAssignments(
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback while the throttled report fetch hasn't produced fund
|
||||
// transactions yet: an account that has never traded still sits at
|
||||
// exactly its opening balance, and balances arrive with the first
|
||||
// sync. Only a cent-exact match counts — a traded account's balance
|
||||
// won't equal any type size, so it falls through and waits for the
|
||||
// reports as before. The matched size is persisted below, so the
|
||||
// assignment survives once the balance starts moving.
|
||||
if (!matched.type) {
|
||||
const balance = client.accountCashBalances[account.id]?.amount;
|
||||
if (typeof balance === 'number') {
|
||||
const attempt = matchAccountType(account.name, balance, types);
|
||||
if (attempt.type) {
|
||||
matched = attempt;
|
||||
matchedSize = balance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (matched.type) {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user