diff --git a/virtweb_frontend/src/routes/VMListRoute.tsx b/virtweb_frontend/src/routes/VMListRoute.tsx index ccb788a..7f9c44c 100644 --- a/virtweb_frontend/src/routes/VMListRoute.tsx +++ b/virtweb_frontend/src/routes/VMListRoute.tsx @@ -31,8 +31,13 @@ export function VMListRoute(): React.ReactElement { const loadKey = React.useRef(1); const load = async () => { - setGroups([undefined, ...(await GroupApi.GetList())]); - setList(await VMApi.GetList()); + const groups: Array = await GroupApi.GetList(); + const list = await VMApi.GetList(); + + if (list.find((v) => !v.group) !== undefined) groups.push(undefined); + + setGroups(groups); + setList(list); }; const reload = () => {