Skip to content

Commit

Permalink
repeat until user passes an input
Browse files Browse the repository at this point in the history
  • Loading branch information
patnir committed Feb 12, 2024
1 parent 13d3241 commit 35fbff3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ironfish-cli/src/commands/wallet/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,16 @@ export class ImportCommand extends IronfishCommand {
}

async importTTY(): Promise<string> {
const userInput = await largePrompt(
'Paste the output of wallet:export, or your spending key',
)
let userInput = (
await largePrompt('Paste the output of wallet:export, or your spending key: ')
).trim()

while (userInput.length === 0) {
userInput = (
await largePrompt('Paste the output of wallet:export, or your spending key: ')
).trim()
}

return userInput.trim()
return userInput
}
}

0 comments on commit 35fbff3

Please sign in to comment.