-
Notifications
You must be signed in to change notification settings - Fork 841
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
Conversation
* 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
* fox build * centered
* Fixed double notification * added fix
… user profile (coral-xyz#3140)" (coral-xyz#3143) This reverts commit c2a5cab.
* 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
* wip * make messages list look good * adds chat support * wipwip hooray * hook up data * hook it all up
* fix dumb eslint rootdir warnings * removes metro app config from main one * fixes annoying eslint
* nft detail updates * fix nfts not loading * updates types * fixes
* cleanup * cleanup
@jeivardan is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
...ages/app-extension/src/components/Unlocked/Settings/YourAccount/EditWallets/RenameWallet.tsx
Outdated
Show resolved
Hide resolved
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.
@hkirat I moved the code to common
} else { | ||
setError(false); | ||
setErrorMessage(""); | ||
setIsPrimaryDisabled(walletName.trim() === "" ? true : false); |
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.
setIsPrimaryDisabled(walletName.trim() === "" ? true : false); | |
setIsPrimaryDisabled(walletName.trim() === ""); |
We can simplify this, it just gives confusion... right?
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.
Yeah! Simplified it. Thanks for the suggestion.
packages/common/src/utils.ts
Outdated
*/ | ||
export function isValidWalletName(walletName: string): boolean { | ||
//regex check to not allow wallet names to start with '@' | ||
let regExp = new RegExp("^(?!@.*$).*"); |
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.
This is too generic variable name, can we improve it?
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.
Yep it is too generic and I've made the changes
} else { | ||
setError(false); | ||
setErrorMessage(""); | ||
setIsNextDisabled(walletName.trim() === "" ? true : false); |
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.
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.
f4232de
to
33f7b8a
Compare
resolves #3202 in both create and rename wallet