diff --git a/drb-frontend/app/alerts/page.tsx b/drb-frontend/app/alerts/page.tsx index c034f65..8d60319 100644 --- a/drb-frontend/app/alerts/page.tsx +++ b/drb-frontend/app/alerts/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { useAuth } from "@/components/AuthProvider"; import { useAlerts } from "@/lib/useAlerts"; import { MachineOutputNotice } from "@/components/ui/MachineOutputNotice"; @@ -32,8 +32,8 @@ function RulesTab({ isAdmin }: { isAdmin: boolean }) { } } - // Load on first render of this tab - if (!loaded) { load(); } + // Load once when this tab mounts (load() self-guards on `loaded`). + useEffect(() => { load(); }, []); async function handleCreate(e: React.FormEvent) { e.preventDefault(); diff --git a/drb-frontend/app/nodes/[id]/page.tsx b/drb-frontend/app/nodes/[id]/page.tsx index 9d0796a..8476918 100644 --- a/drb-frontend/app/nodes/[id]/page.tsx +++ b/drb-frontend/app/nodes/[id]/page.tsx @@ -120,7 +120,10 @@ export default function NodeDetailPage() { const [approving, setApproving] = useState(false); const [deleting, setDeleting] = useState(false); const { systems } = useSystems(); - const { calls } = useCalls(20); + // TODO(server-26#109 item5): server-side node_id filter. A where("node_id","==",id) + // alongside the existing org_id equality + started_at orderBy needs a brand-new + // composite index, so for now pull a wider window and filter client-side. + const { calls } = useCalls(200); const { isAdmin } = useAuth(); const systemMap = Object.fromEntries(systems.map((s) => [s.system_id, s]));