-
Notifications
You must be signed in to change notification settings - Fork 103
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: add balance logic in implicit account creation wizard #8075
feat: add balance logic in implicit account creation wizard #8075
Conversation
…t-management-list-ui
…ress and disable the password input
packages/desktop/views/dashboard/account-management/AccountManagement.svelte
…nt-info packages/desktop/views/dashboard/account-management/AccountManagement.svelte
…nt-info packages/desktop/views/dashboard/account-management/AccountManagement.svelte
packages/desktop/views/dashboard/account-management/AccountManagement.svelte
…w' and 'feat/add-account-info-logic' of github.com:iotaledger/firefly into feat/update-logic-for-activate-account-in-details-view
…w' and 'develop-iota2.0' of github.com:iotaledger/firefly into feat/update-logic-for-activate-account-in-details-view
…count-in-details-view
…w' and 'develop-iota2.0' of github.com:iotaledger/firefly into feat/update-logic-for-activate-account-in-details-view
… into feat/add-balance-logic-to-implicit-wizard-and-management
...views/dashboard/wallet/views/implicit-account-creation-multistep/FundConfirmationView.svelte
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.
Nice 👌🏼
@@ -54,10 +54,21 @@ | |||
$: accountId = isAccountOutput(selectedOutput) ? (selectedOutput?.output as AccountOutput)?.accountId : null | |||
$: address = accountId ? getBech32AddressFromAddressTypes(new AccountAddress(accountId)) : null | |||
$: isMainAccount = accountId && accountId === $selectedWalletMainAccountId | |||
$: balance = getAccountBalance(selectedOutput) |
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.
You should probably pass isImplicitAccount
to getAccountBalance
, so if isImplicitAccount
changes for any reason, the balance will be updated, 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.
i'm a bit confused about why it might be necessary to pass it. If an implicitAccount
is created through handleActivateAccount
, it's not like it would spontaneously change, right?
sorry, but I don't see the situation in which this would happen... 🙈
could you help me understand this better? 🙏 maybe i'm wrong..
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.
Yes, I agree with Eva, the moment the implicitOutput
stops being implicit the selectedOutput
will also change
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.
I prefer explicit reactive dependencies over assumptions, if L53 changes in the future, isImplicitAccount
might start changing its value because of another factor than selectedOutput
, and balance
might get out of sync if you forget to update the logic of getAccountBalance
. I don't see how passing isImplicitAccount
would be a problem
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.
Okeey, makes sense 👌🏼
$: formattedWalletBalance = walletBalance | ||
? formatTokenAmountBestMatch(Number(walletBalance.baseCoin?.available), baseCoin?.metadata) | ||
: '-' |
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 makes more sense, right?
$: formattedWalletBalance = walletBalance | |
? formatTokenAmountBestMatch(Number(walletBalance.baseCoin?.available), baseCoin?.metadata) | |
: '-' | |
$: formattedWalletBalance = walletBalance?.baseCoin?.available | |
? formatTokenAmountBestMatch(Number(walletBalance.baseCoin.available), baseCoin?.metadata) | |
: '-' |
…t-wizard-and-management packages/desktop/views/dashboard/wallet/views/implicit-account-creation-multistep/FundConfirmationView.svelte
…t-wizard-and-management
@@ -54,10 +54,21 @@ | |||
$: accountId = isAccountOutput(selectedOutput) ? (selectedOutput?.output as AccountOutput)?.accountId : null | |||
$: address = accountId ? getBech32AddressFromAddressTypes(new AccountAddress(accountId)) : null | |||
$: isMainAccount = accountId && accountId === $selectedWalletMainAccountId | |||
$: balance = getAccountBalance(selectedOutput) |
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.
I prefer explicit reactive dependencies over assumptions, if L53 changes in the future, isImplicitAccount
might start changing its value because of another factor than selectedOutput
, and balance
might get out of sync if you forget to update the logic of getAccountBalance
. I don't see how passing isImplicitAccount
would be a problem
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.
Unrelated to this PR but I don't see why
listBlockKeysFeature(selectedOutput) |
onMount
, what if the output changes?
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.
🆒
Summary
Changelog
Testing
Platforms
Instructions
...
Checklist