fix(striker-ui): don't remove optional networks upon removing last interface

main
Tsu-ba-me 2 years ago
parent 585030861f
commit 509c411642
  1. 8
      striker-ui/components/NetworkInitForm.tsx

@ -552,18 +552,10 @@ const NetworkInitForm: FC = () => {
networkInterface={networkInterface} networkInterface={networkInterface}
onClose={() => { onClose={() => {
interfaces[networkInterfaceIndex] = undefined; interfaces[networkInterfaceIndex] = undefined;
networkInterfaceInputMap[ networkInterfaceInputMap[
networkInterfaceUUID networkInterfaceUUID
].isApplied = false; ].isApplied = false;
if (
isNetworkOptional &&
interfaces.length === 0
) {
networkInputs.splice(networkIndex, 1);
}
setNetworkInterfaceInputMap({ setNetworkInterfaceInputMap({
...networkInterfaceInputMap, ...networkInterfaceInputMap,
}); });

Loading…
Cancel
Save