From 77ff2d9ad1e6c43fa6d5763b36e1f33fe7b65466 Mon Sep 17 00:00:00 2001 From: Atatakai Date: Wed, 28 Aug 2024 12:48:46 +0400 Subject: [PATCH] (launch) fix: allow empty agentIds --- apps/launch/common-util/functions/stakingContract.ts | 2 +- .../components/MyStakingContracts/Create/useFieldRules.tsx | 1 - .../MyStakingContracts/Details/ContractConfiguration.tsx | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/launch/common-util/functions/stakingContract.ts b/apps/launch/common-util/functions/stakingContract.ts index f08edf60..9903d4d7 100644 --- a/apps/launch/common-util/functions/stakingContract.ts +++ b/apps/launch/common-util/functions/stakingContract.ts @@ -55,7 +55,7 @@ export const getStakingContractInitPayload = ({ livenessPeriod, timeForEmissions, numAgentInstances, - agentIds: agentIds.split(/,\s?/).map((agentId) => Number(agentId)), + agentIds: agentIds ? agentIds.split(/,\s?/).map((agentId) => Number(agentId)) : [], threshold, configHash, activityChecker, diff --git a/apps/launch/components/MyStakingContracts/Create/useFieldRules.tsx b/apps/launch/components/MyStakingContracts/Create/useFieldRules.tsx index ecb3cb8b..fea8bfb0 100644 --- a/apps/launch/components/MyStakingContracts/Create/useFieldRules.tsx +++ b/apps/launch/components/MyStakingContracts/Create/useFieldRules.tsx @@ -101,7 +101,6 @@ export const useFieldRules = (): StakingDepositRules => { numAgentInstances: { rules: getGenericFieldRules(FieldConfig.numAgentInstances.name) }, agentIds: { rules: [ - ...getGenericFieldRules(FieldConfig.agentIds.name), { ...FORM_VALIDATION.validateCommaSeparatedList }, ], }, diff --git a/apps/launch/components/MyStakingContracts/Details/ContractConfiguration.tsx b/apps/launch/components/MyStakingContracts/Details/ContractConfiguration.tsx index 0569cdda..5fdacb72 100644 --- a/apps/launch/components/MyStakingContracts/Details/ContractConfiguration.tsx +++ b/apps/launch/components/MyStakingContracts/Details/ContractConfiguration.tsx @@ -129,7 +129,8 @@ const AgentIds: FC<{ address: Address }> = ({ address }) => { return data.map((id) => (