Skip to content
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

Merged
merged 7 commits into from
Feb 13, 2024
Merged

Conversation

patnir
Copy link
Contributor

@patnir patnir commented Feb 12, 2024

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.

[ ] Yes

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.

[ ] Yes

@patnir patnir requested a review from a team as a code owner February 12, 2024 23:17
Comment on lines 27 to 34
let userInput = (await fetchResponse(question)).trim()

while (userInput.length === 0 && options?.required) {
userInput = (await fetchResponse(question)).trim()
}

return userInput
}
Copy link
Contributor Author

@patnir patnir Feb 13, 2024

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

@patnir patnir changed the title Rahul/long prompt for account import repeat long prompt for account import Feb 13, 2024
@@ -4,7 +4,7 @@
import readline from 'readline'

// Most effective way to take in a large textual prompt input without affecting UX
Copy link
Contributor

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.

@patnir patnir requested a review from jowparks February 13, 2024 17:02
Comment on lines 35 to 38
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jowparks jowparks force-pushed the rahul/longPromptForAccountImport branch 2 times, most recently from 1f0aeb3 to 9df58a7 Compare February 13, 2024 18:32
@jowparks jowparks force-pushed the rahul/longPromptForAccountImport branch from 9df58a7 to 87e3495 Compare February 13, 2024 18:36
@jowparks jowparks force-pushed the rahul/longPromptForAccountImport branch from 87e3495 to d05925f Compare February 13, 2024 18:38
@patnir patnir merged commit 00811ee into staging Feb 13, 2024
9 checks passed
@patnir patnir deleted the rahul/longPromptForAccountImport branch February 13, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants