chore: finish frontend ESLint migration #18
Enable every plugin recommended preset and replace Biome with ESLint formatting. Preserve API contracts and JSX whitespace; verify source, tests, builds and tooling.
This commit is contained in:
@@ -9,35 +9,35 @@ function useAccountsPageViewModel() {
|
||||
const accounts = useBrokerageAccounts();
|
||||
const sync = useScreenSync({ screen: "accounts" }, [accounts]);
|
||||
if (
|
||||
!accounts.data ||
|
||||
(accounts.meta?.availability === "partial" && !accounts.data.length)
|
||||
!accounts.data
|
||||
|| (accounts.meta?.availability === "partial" && accounts.data.length === 0)
|
||||
) {
|
||||
if (!accounts.isError && accounts.meta?.sync.state !== "failed")
|
||||
return { state: "loading" as const };
|
||||
if (accounts.isError || accounts.meta?.sync.state === "failed")
|
||||
return {
|
||||
state: "error" as const,
|
||||
code: apiErrorCode(accounts.error),
|
||||
retry: sync.retry,
|
||||
state: "error" as const,
|
||||
};
|
||||
}
|
||||
if (!accounts.data?.length)
|
||||
return {
|
||||
state: "empty" as const,
|
||||
lastSuccessfulAt: accounts.meta?.lastSuccessfulAt,
|
||||
refreshing: accounts.isFetching || sync.refreshing,
|
||||
sourceError: sync.sourceError,
|
||||
refreshError: accounts.isError || sync.transportError || sync.sourceError,
|
||||
refreshing: accounts.isFetching || sync.refreshing,
|
||||
retry: sync.retry,
|
||||
sourceError: sync.sourceError,
|
||||
state: "empty" as const,
|
||||
};
|
||||
return {
|
||||
state: "loaded" as const,
|
||||
accounts: brokerageAccountCards(accounts.data, accounts.meta?.dependencies),
|
||||
lastSuccessfulAt: accounts.meta?.lastSuccessfulAt,
|
||||
refreshing: accounts.isFetching || sync.refreshing,
|
||||
sourceError: sync.sourceError,
|
||||
refreshError: accounts.isError || sync.transportError || sync.sourceError,
|
||||
refreshing: accounts.isFetching || sync.refreshing,
|
||||
retry: sync.retry,
|
||||
sourceError: sync.sourceError,
|
||||
state: "loaded" as const,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user