Skip to content

Commit

Permalink
Filtering ipv4 from missing features as ip is already added
Browse files Browse the repository at this point in the history
  • Loading branch information
maayarosama committed Feb 9, 2025
1 parent 9f251b8 commit e1bf6f1
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default {
placeholderNode.value = node;
const features = getFeatures(gridStore, filters.value);
const missingFeatures = features.filter(value => !node.features.includes(value as Features));
let missingFeatures = features.filter(value => !node.features.includes(value as Features));
if (node === undefined || node === null) {
throw `Node ${nodeId} is not on the grid`;
}
Expand Down Expand Up @@ -178,12 +178,13 @@ export default {
case props.filters.ipv4 && farms[0].publicIps.every(p => p.contract_id !== 0):
throw `Node ${nodeId} is not assigned to a PublicIP`;
case missingFeatures.length > 0:
missingFeatures = missingFeatures.filter(feature => feature !== "ipv4");
throw `Node ${nodeId} does not support ${missingFeatures
.slice(0, -1)
.map(feature => NetworkFeatures[feature as keyof typeof NetworkFeatures])
.join(", ")}${missingFeatures.length > 1 ? " or " : ""}${
NetworkFeatures[missingFeatures[missingFeatures.length - 1] as keyof typeof NetworkFeatures]
} Feature${missingFeatures.length > 1 ? "s" : ""}. Please check compatibility or upgrade the node.`;
.join(", ")} Feature${
missingFeatures.length > 1 ? "s" : ""
}. Please check compatibility or upgrade the node.`;
}
const args = [nodeId, "proxy", gridStore.client.config.proxyURL] as const;
Expand Down

0 comments on commit e1bf6f1

Please sign in to comment.