Skip to content

Commit

Permalink
Merge pull request #4429 from EdgeApp/jon/hbar-activation-ui2
Browse files Browse the repository at this point in the history
- changed: Retheme CreateWalletAccountSelectScene
  • Loading branch information
swansontec authored Sep 4, 2023
2 parents e52d3a6 + a6fe8bb commit a6bbd8f
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 381 deletions.
4 changes: 0 additions & 4 deletions src/__tests__/scenes/CreateWalletAccountSetupScene.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ describe('CreateWalletAccountSelect', () => {
walletType: 'wallet:bitcoin',
currencyCode: 'BTC'
} as any,
selectedFiat: {
label: 'USD',
value: 'USD'
},
isReactivation: true,
existingWalletId: 'myWallet'
})}
Expand Down
7 changes: 0 additions & 7 deletions src/actions/WalletActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { MapObject } from '../types/types'
import { getCurrencyCode, getCurrencyInfos, getToken, makeCreateWalletType } from '../util/CurrencyInfoHelpers'
import { getWalletName } from '../util/CurrencyWalletHelpers'
import { fetchInfo } from '../util/network'
import { getSupportedFiats } from '../util/utils'
import { refreshConnectedWallets } from './FioActions'

export interface SelectWalletTokenParams {
Expand Down Expand Up @@ -93,7 +92,6 @@ function selectEOSWallet(navigation: NavigationBase, walletId: string, currencyC
const state = getState()
const wallet = state.core.account.currencyWallets[walletId]
const {
fiatCurrencyCode,
name,
currencyInfo: { currencyCode, pluginId }
} = wallet
Expand All @@ -113,17 +111,13 @@ function selectEOSWallet(navigation: NavigationBase, walletId: string, currencyC
await dispatch(updateWalletsRequest())
// not activated yet
// find fiat and crypto (EOSIO) types and populate scene props
const supportedFiats = getSupportedFiats()
const fiatTypeIndex = supportedFiats.findIndex(fiatType => fiatType.value === fiatCurrencyCode.replace('iso:', ''))
const selectedFiat = supportedFiats[fiatTypeIndex]
const currencyInfos = getCurrencyInfos(state.core.account)
const currencyInfo = currencyInfos.find(info => info.currencyCode === currencyCode)
if (!currencyInfo) throw new Error('CannotFindCurrencyInfo')
const selectedWalletType = makeCreateWalletType(currencyInfo)
const specialCurrencyInfo = getSpecialCurrencyInfo(pluginId)
if (specialCurrencyInfo.skipAccountNameValidation) {
navigation.push('createWalletAccountSelect', {
selectedFiat: selectedFiat,
selectedWalletType,
accountName: walletName,
existingWalletId: walletId
Expand All @@ -132,7 +126,6 @@ function selectEOSWallet(navigation: NavigationBase, walletId: string, currencyC
const createWalletAccountSetupSceneProps = {
accountHandle: '',
selectedWalletType,
selectedFiat,
isReactivation: true,
existingWalletId: walletId
}
Expand Down
Loading

0 comments on commit a6bbd8f

Please sign in to comment.