fix(account): show source metadata on empty account and income (WealthLedger/frontend#55) (#133)
This commit was merged in pull request #133.
This commit is contained in:
@@ -41,4 +41,14 @@ function isApiErrorCode(
|
||||
return value === expected;
|
||||
}
|
||||
|
||||
export { ApiErrorCode, apiErrorCode, isApiErrorCode };
|
||||
// Confirmed loss of access to the brokerage data. UNAUTHORIZED is a session
|
||||
// failure with its own refresh/sign-out path, so it is deliberately excluded.
|
||||
function isBrokerageAccessLoss(code?: string): boolean {
|
||||
return [
|
||||
ApiErrorCode.InvalidTbankToken,
|
||||
ApiErrorCode.NotFound,
|
||||
ApiErrorCode.TbankNotConnected,
|
||||
].some(loss => isApiErrorCode(code, loss));
|
||||
}
|
||||
|
||||
export { ApiErrorCode, apiErrorCode, isApiErrorCode, isBrokerageAccessLoss };
|
||||
|
||||
Reference in New Issue
Block a user