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

enhancement: don't allow wallet names to start with '@' #3202 #3513

Closed
wants to merge 2,619 commits into from

Conversation

jeivardan
Copy link

resolves #3202 in both create and rename wallet

renameWallet

createWallet

callensm and others added 30 commits March 2, 2023 11:30
* adds crypto shim for ios/android

* removes react-native-get-random-values
* removes app-extension from recoil

* adds eslint rule

* re-export useBreakpoints from recoil and pass it through

* fixes

* removes old breakpoints file
* Delete chats with a new queue

* fixed stuff
* Fixed double notification

* added fix
* adjustments

* fix mnemonic input

* fix scrolling on secret recovery phrase

* cleanup and fix

* fix
Co-authored-by: Salim Karim <metasal@gmx.com>
* Moved Searchbox to react-common

* fixed import
@vercel
Copy link

vercel bot commented Mar 31, 2023

@jeivardan is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@hkirat hkirat self-requested a review March 31, 2023 19:15
Copy link
Author

@jeivardan jeivardan left a comment

Choose a reason for hiding this comment

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

@hkirat I moved the code to common

@jeivardan jeivardan requested a review from hkirat April 1, 2023 05:02
@jeivardan jeivardan marked this pull request as draft April 4, 2023 17:09
@jeivardan jeivardan marked this pull request as ready for review April 4, 2023 17:09
} else {
setError(false);
setErrorMessage("");
setIsPrimaryDisabled(walletName.trim() === "" ? true : false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
setIsPrimaryDisabled(walletName.trim() === "" ? true : false);
setIsPrimaryDisabled(walletName.trim() === "");

We can simplify this, it just gives confusion... right?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah! Simplified it. Thanks for the suggestion.

*/
export function isValidWalletName(walletName: string): boolean {
//regex check to not allow wallet names to start with '@'
let regExp = new RegExp("^(?!@.*$).*");
Copy link
Contributor

Choose a reason for hiding this comment

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

This is too generic variable name, can we improve it?

Copy link
Author

Choose a reason for hiding this comment

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

Yep it is too generic and I've made the changes

} else {
setError(false);
setErrorMessage("");
setIsNextDisabled(walletName.trim() === "" ? true : false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
setIsNextDisabled(walletName.trim() === "" ? true : false);
setIsNextDisabled(walletName.trim() === "");

The variable name in walletName check regEx  is updated to be more descriptive. Additionally, a minor change was made to improve the readability of the code.
@jeivardan jeivardan requested a review from getusha April 10, 2023 05:17
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.

don't allow wallet names to start with @