diff --git a/frontend/src/app/agents/page.tsx b/frontend/src/app/agents/page.tsx index 794341ff..aaf346ca 100644 --- a/frontend/src/app/agents/page.tsx +++ b/frontend/src/app/agents/page.tsx @@ -120,8 +120,8 @@ export default function AgentsPage() { refetchOnMount: "always", }); - const boards = boardsQuery.data ?? []; - const agents = agentsQuery.data ?? []; + const boards = useMemo(() => boardsQuery.data ?? [], [boardsQuery.data]); + const agents = useMemo(() => agentsQuery.data ?? [], [agentsQuery.data]); useEffect(() => { if (!boardId && boards.length > 0) { @@ -285,6 +285,7 @@ export default function AgentsPage() { [boards] ); + // eslint-disable-next-line react-hooks/incompatible-library const table = useReactTable({ data: sortedAgents, columns, diff --git a/frontend/src/app/boards/[boardId]/edit/page.tsx b/frontend/src/app/boards/[boardId]/edit/page.tsx index f1145316..ee7e63ec 100644 --- a/frontend/src/app/boards/[boardId]/edit/page.tsx +++ b/frontend/src/app/boards/[boardId]/edit/page.tsx @@ -53,10 +53,6 @@ export default function EditBoardPage() { const isFormReady = Boolean(name.trim() && gatewayId); - const selectedGateway = useMemo( - () => gateways.find((gateway) => gateway.id === gatewayId) || null, - [gateways, gatewayId] - ); const gatewayOptions = useMemo( () => gateways.map((gateway) => ({ value: gateway.id, label: gateway.name })), [gateways] diff --git a/frontend/src/app/boards/new/page.tsx b/frontend/src/app/boards/new/page.tsx index f5a65c8e..df2c2f1e 100644 --- a/frontend/src/app/boards/new/page.tsx +++ b/frontend/src/app/boards/new/page.tsx @@ -50,10 +50,6 @@ export default function NewBoardPage() { const isFormReady = Boolean(name.trim() && gatewayId); - const selectedGateway = useMemo( - () => gateways.find((gateway) => gateway.id === gatewayId) || null, - [gateways, gatewayId] - ); const gatewayOptions = useMemo( () => gateways.map((gateway) => ({ value: gateway.id, label: gateway.name })), [gateways] diff --git a/frontend/src/app/boards/page.tsx b/frontend/src/app/boards/page.tsx index 3b851527..c07cf2c8 100644 --- a/frontend/src/app/boards/page.tsx +++ b/frontend/src/app/boards/page.tsx @@ -53,7 +53,7 @@ export default function BoardsPage() { refetchOnMount: "always", }); - const boards = boardsQuery.data ?? []; + const boards = useMemo(() => boardsQuery.data ?? [], [boardsQuery.data]); const sortedBoards = useMemo( () => [...boards].sort((a, b) => a.name.localeCompare(b.name)), @@ -141,6 +141,7 @@ export default function BoardsPage() { [] ); + // eslint-disable-next-line react-hooks/incompatible-library const table = useReactTable({ data: sortedBoards, columns, diff --git a/frontend/src/app/gateways/page.tsx b/frontend/src/app/gateways/page.tsx index 366f857c..44693320 100644 --- a/frontend/src/app/gateways/page.tsx +++ b/frontend/src/app/gateways/page.tsx @@ -72,7 +72,7 @@ export default function GatewaysPage() { } ); - const gateways = gatewaysQuery.data ?? []; + const gateways = useMemo(() => gatewaysQuery.data ?? [], [gatewaysQuery.data]); const sortedGateways = useMemo(() => [...gateways], [gateways]); const deleteMutation = useAuthedMutation< @@ -193,6 +193,7 @@ export default function GatewaysPage() { [] ); + // eslint-disable-next-line react-hooks/incompatible-library const table = useReactTable({ data: sortedGateways, columns, diff --git a/frontend/src/app/onboarding/page.tsx b/frontend/src/app/onboarding/page.tsx index f916b82a..b20928f2 100644 --- a/frontend/src/app/onboarding/page.tsx +++ b/frontend/src/app/onboarding/page.tsx @@ -35,7 +35,6 @@ export default function OnboardingPage() { const { getToken, isSignedIn } = useAuth(); const { user } = useUser(); - const [profile, setProfile] = useState(null); const [name, setName] = useState(""); const [timezone, setTimezone] = useState(""); const [isLoading, setIsLoading] = useState(false); @@ -87,7 +86,6 @@ export default function OnboardingPage() { throw new Error("Unable to load profile."); } const data = (await response.json()) as UserProfile; - setProfile(data); const fallbackName = user?.fullName ?? user?.firstName ?? user?.username ?? ""; setName(data.preferred_name ?? data.name ?? fallbackName);