refactor: centralize frontend auth query gating
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link, useMatch } from "react-router";
|
||||
import { useBrokerageAccounts } from "@/entities/brokerage-account";
|
||||
import { useAuth } from "@/features/auth";
|
||||
|
||||
type Crumb = { label: string; to?: string };
|
||||
|
||||
@@ -45,8 +44,7 @@ function AccountBreadcrumbs({
|
||||
events: boolean;
|
||||
operations: boolean;
|
||||
}) {
|
||||
const { accessToken } = useAuth();
|
||||
const { data: accounts } = useBrokerageAccounts(accessToken);
|
||||
const { data: accounts } = useBrokerageAccounts();
|
||||
const { t } = useTranslation();
|
||||
const accountName =
|
||||
accounts?.find((account) => account.id === accountId)?.name ??
|
||||
|
||||
Reference in New Issue
Block a user