-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repeat
long prompt for account import
#4721
Conversation
ironfish-cli/src/utils/longPrompt.ts
Outdated
let userInput = (await fetchResponse(question)).trim() | ||
|
||
while (userInput.length === 0 && options?.required) { | ||
userInput = (await fetchResponse(question)).trim() | ||
} | ||
|
||
return userInput | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll need this pattern of re-prompting the user when they enter an empty string in multiple places
repeat
long prompt for account import
9bbe6a3
to
4b50b82
Compare
@@ -4,7 +4,7 @@ | |||
import readline from 'readline' | |||
|
|||
// Most effective way to take in a large textual prompt input without affecting UX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of separate methods here, lets just use recursion.
ironfish-cli/src/utils/longPrompt.ts
Outdated
const rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1f0aeb3
to
9df58a7
Compare
9df58a7
to
87e3495
Compare
87e3495
to
d05925f
Compare
Summary
Changes the long prompt UX to repeat the prompt if the user passes an empty string/ no value.
Changes account import to use this helper function
Testing Plan
Documentation
Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference)? If yes, link a
related documentation pull request for the website.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.