Hide default group if no VM is in this group
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2024-11-02 18:35:41 +01:00
parent 9755bacc55
commit 2b58ce4d5e

View File

@ -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<string | undefined> = await GroupApi.GetList();
const list = await VMApi.GetList();
if (list.find((v) => !v.group) !== undefined) groups.push(undefined);
setGroups(groups);
setList(list);
};
const reload = () => {