-
Notifications
You must be signed in to change notification settings - Fork 212
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
feat(wallet-ui): provision new wallet #6289
Conversation
ff0ad4c
to
1ff7a4c
Compare
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.
Doesn't seem ready for merge. I left some comments. Also the git commits are noisy. Please clean those up for the changelog
return; | ||
} | ||
|
||
setError(''); |
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.
why is this necessary? seems an odd place for it. do you want to reset the error when the user initiates a new action?
why use empty string instead of null or undefined?
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.
Yea we want to reset the error when the user initiates a new action.
I sometimes get in the habit of using empty string because certain input elements don't play well with null, but no reason otherwise. Typically I never set things to undefined
explicitly but maybe that's okay as well.
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.
Yea we want to reset the error when the user initiates a new action.
Then please put it where they initiate the action. Either at the top of this function or sooner.
certain input elements don't play well with null, but no reason otherwise
Please use null
for "no error". Empty string could be an error that just doesn't have any description. If there are elements where this causes problems I'd like to fix them
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.
Changed to use null instead of empty string
I didn't want to have two setErrors in the case of the early return above. I just split this into another function to make it more readable if that's any better?
<b>Wallet Address:</b> {address} | ||
</DialogContentText> | ||
<DialogContentText sx={{ pt: 2 }}> | ||
There is no smart wallet provisioned for this address yet. A fee |
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.
if we're not going to read it from params, at least make it a const. should have a comment indicating the tech debt and why
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.
Made a const and TODO
const { href, smartConnectionMethod } = connectionConfig; | ||
let publicAddress; | ||
if ( | ||
smartConnectionMethod === SmartConnectionMethod.KEPLR && | ||
keplrConnection | ||
) { | ||
publicAddress = keplrConnection.address; | ||
} else if (smartConnectionMethod === SmartConnectionMethod.READ_ONLY) { | ||
publicAddress = connectionConfig.publicAddress; | ||
} |
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.
consider a helper method so this is one line here assigning to a const
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.
Done
value: { | ||
address: b64address, | ||
nickname: 'my wallet', | ||
// XXX dry with PowerFlags const |
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.
how about now?
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.
One concern I have is when we import these packages just to use a const or type etc, we increase the bundle size by a lot. Maybe it's better to just leave 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.
Doesn't the bundler have tree shaking? If not please make a ticket to get that working and include it in the comment here as to why these aren't imported yet
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.
Looks like it does have tree shaking yes. Importing this only increased the bundle size by ~4kB. Still the bundle size is getting up there, so I created a separate issue for that #6291
You mean just squash? I'm not sure how else. |
I was thinking an interactive rebase with renaming. E.g. |
b67f22c
to
db9966c
Compare
Ah okay, yea just tried to clean up the messages now |
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.
Approved assuming the PR will be squashed with a feat
title.
6134bb7
to
b2f71fd
Compare
fixes: #6211