Skip to content

Commit

Permalink
Merge pull request #5292 from EdgeApp/matthew/memory-wallet-fiat
Browse files Browse the repository at this point in the history
Use account default fiat for transaction fee display in `SweepPrivateKeyCalculateFeeScene`
  • Loading branch information
peachbits authored Oct 9, 2024
2 parents 5428585 + e30ac3c commit 19573cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- changed: Navigate to wallet list after restoring wallets
- fixed: Use account default fiat for transaction fee display in `SweepPrivateKeyCalculateFeeScene`

## 4.15.0

Expand Down
3 changes: 2 additions & 1 deletion src/components/scenes/SweepPrivateKeyCalculateFeeScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const SweepPrivateKeyCalculateFeeComponent = (props: Props) => {
const theme = useTheme()
const styles = getStyles(theme)

const defaultFiat = useSelector(state => state.ui.settings.defaultIsoFiat)
const exchangeRates = useSelector(state => state.exchangeRates)
const displayDenominations = useSelector(state => {
const { denominationSettings = {} } = state.ui.settings
Expand Down Expand Up @@ -97,7 +98,7 @@ const SweepPrivateKeyCalculateFeeComponent = (props: Props) => {
const exchangeDenom = denominations.find(denom => denom.name === currencyCode) as EdgeDenomination
const displayDenom = displayDenominations[pluginId]?.[currencyCode] ?? exchangeDenom

const transactionFee = convertTransactionFeeToDisplayFee(currencyCode, receivingWallet.fiatCurrencyCode, exchangeRates, tx, displayDenom, exchangeDenom)
const transactionFee = convertTransactionFeeToDisplayFee(currencyCode, defaultFiat, exchangeRates, tx, displayDenom, exchangeDenom)
const fiatAmount = transactionFee.fiatAmount === '0' ? '0' : ` ${transactionFee.fiatAmount}`
const feeSyntax = `${transactionFee.cryptoSymbol ?? ''} ${truncateDecimals(transactionFee.cryptoAmount)} (${
transactionFee.fiatSymbol ?? ''
Expand Down

0 comments on commit 19573cb

Please sign in to comment.