Hide default group if no VM is in this group
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9755bacc55
commit
2b58ce4d5e
@ -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 = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user