fix: use host_uuid instead of index number to determine server's host

main
Josue 4 years ago committed by Tsu-ba-me
parent 24e4509c8d
commit 6b2d3700f9
  1. 9
      striker-ui/components/Servers.tsx
  2. 2
      striker-ui/types/AnvilServers.d.ts

@ -88,14 +88,13 @@ const Servers = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => {
anvil[
anvil.findIndex((a) => a.anvil_uuid === uuid)
].hosts.map(
(
host: AnvilStatusHost,
index: number,
): JSX.Element => (
(host: AnvilStatusHost): JSX.Element => (
<Box p={1} key={host.host_uuid}>
<BodyText
text={host.host_name}
selected={server.server_host_index === index}
selected={
server.server_host_uuid === host.host_uuid
}
/>
</Box>
),

@ -10,7 +10,7 @@ declare type AnvilServer = {
| 'crashed'
| 'pmsuspended'
| 'migrating';
server_host_index: number;
server_host_uuid: string;
};
declare type AnvilServers = {

Loading…
Cancel
Save