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:
@@ -3,7 +3,12 @@ import createQueryClient from "openapi-react-query";
|
||||
|
||||
import type { paths } from "./generated/schema";
|
||||
|
||||
import { ApiErrorCode, apiErrorCode, isApiErrorCode } from "./problem-details";
|
||||
import {
|
||||
ApiErrorCode,
|
||||
apiErrorCode,
|
||||
isApiErrorCode,
|
||||
isBrokerageAccessLoss,
|
||||
} from "./problem-details";
|
||||
|
||||
const HTTP_UNAUTHORIZED = 401;
|
||||
const HTTP_REQUEST_TIMEOUT = 408;
|
||||
@@ -165,12 +170,8 @@ function isNetworkFailure(error: unknown): boolean {
|
||||
}
|
||||
|
||||
function isPermanentCode(code?: string): boolean {
|
||||
return [
|
||||
ApiErrorCode.InvalidTbankToken,
|
||||
ApiErrorCode.NotFound,
|
||||
ApiErrorCode.TbankNotConnected,
|
||||
ApiErrorCode.Unauthorized,
|
||||
].some(permanent => isApiErrorCode(code, permanent));
|
||||
return isBrokerageAccessLoss(code)
|
||||
|| isApiErrorCode(code, ApiErrorCode.Unauthorized);
|
||||
}
|
||||
|
||||
function isTransientReadFailure(
|
||||
|
||||
Reference in New Issue
Block a user