swarm UI: key LinkedAccounts by hive and agent
Selecting another agent kept the previous agent's rows on screen until the new fetch landed. Keying both mounts by hive/agent remounts the component on an agent change; a version bump still refetches in place. Refs #4855
This commit is contained in:
parent
3380c1915f
commit
4fd1380a5f
2 changed files with 5 additions and 0 deletions
|
|
@ -394,6 +394,7 @@ export function AgentsPage() {
|
|||
<>
|
||||
{a.hive ? (
|
||||
<LinkedAccounts
|
||||
key={`${a.hive}/${a.name}`}
|
||||
hive={a.hive}
|
||||
agent={a.name}
|
||||
version={linkVersion}
|
||||
|
|
@ -600,6 +601,7 @@ export function AgentsPage() {
|
|||
<dd>
|
||||
{detailTarget.hive ? (
|
||||
<LinkedAccounts
|
||||
key={`${detailTarget.hive}/${detailTarget.name}`}
|
||||
hive={detailTarget.hive}
|
||||
agent={detailTarget.name}
|
||||
version={linkVersion}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
// Fetched on mount and again whenever `version` changes; `AgentsPage` bumps
|
||||
// it when a link dialog closes, so an account linked there shows up without
|
||||
// waiting for a reload.
|
||||
//
|
||||
// Its state belongs to one agent: callers key it by hive and agent, so
|
||||
// switching agents remounts it instead of showing the previous agent's rows.
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js";
|
||||
import { Badge } from "@hive/shared/badge.js";
|
||||
|
|
|
|||
Loading…
Reference in a new issue