From e0c2a6449622efdeb935d0ceafc3d19f292434a2 Mon Sep 17 00:00:00 2001 From: shuplenkov Date: Fri, 21 Apr 2023 17:57:22 +0300 Subject: [PATCH] fix(dashamte): select number of masternodes during local setup freezes --- .../listr/tasks/setup/setupLocalPresetTaskFactory.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/dashmate/src/listr/tasks/setup/setupLocalPresetTaskFactory.js b/packages/dashmate/src/listr/tasks/setup/setupLocalPresetTaskFactory.js index 023affc64cc..a7a849715a0 100644 --- a/packages/dashmate/src/listr/tasks/setup/setupLocalPresetTaskFactory.js +++ b/packages/dashmate/src/listr/tasks/setup/setupLocalPresetTaskFactory.js @@ -39,12 +39,18 @@ function setupLocalPresetTaskFactory( enabled: (ctx) => ctx.nodeCount === undefined, task: async (ctx, task) => { ctx.nodeCount = await task.prompt({ - type: 'Numeral', + type: 'input', message: 'Enter the number of masternodes', initial: 3, - float: false, - min: 3, validate: (state) => { + if (Number.isNaN(+state)) { + return 'You must set a number of masternodes'; + } + + if (!Number.isInteger(+state)) { + return 'Must be an integer'; + } + if (+state < 3) { return 'You must set not less than 3'; }