Skip to content

Commit 4580fcf

Browse files
authored
Merge pull request #250 from forbole/dev
fix ledger add account to wallet issue
2 parents 3397bb3 + 464510e commit 4580fcf

File tree

10 files changed

+19
-13
lines changed

10 files changed

+19
-13
lines changed

components/AddAccountButton/index.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { Dialog, IconButton, useTheme } from '@material-ui/core'
33
import useTranslation from 'next-translate/useTranslation'
44
import React from 'react'
5+
import get from 'lodash/get'
56
import useStyles from './styles'
67
import { useWalletsContext } from '../../contexts/WalletsContext'
78
import useIconProps from '../../misc/useIconProps'
@@ -71,6 +72,7 @@ const AddAccountButton: React.FC<AddAccountButtonProps> = ({ walletId }) => {
7172

7273
React.useEffect(() => {
7374
if (dialogOpen) {
75+
setCrypto('')
7476
setSecurityPassword('')
7577
setStage(wallet.type === 'ledger' ? Stage.ConnectLedger : Stage.SecurityPassword, true)
7678
}
@@ -93,10 +95,14 @@ const AddAccountButton: React.FC<AddAccountButtonProps> = ({ walletId }) => {
9395
{stage === Stage.ConnectLedger ? (
9496
<ConnectLedgerDialogContent
9597
onConnect={(transport) => {
96-
ledgerTransport = transport
97-
setStage(Stage.SelectNetwork)
98+
if (!crypto) {
99+
setStage(Stage.SelectNetwork)
100+
} else {
101+
ledgerTransport = transport
102+
setStage(Stage.SelectAddresses)
103+
}
98104
}}
99-
ledgerAppName={cryptocurrencies[crypto].ledgerAppName}
105+
ledgerAppName={get(cryptocurrencies[crypto], 'ledgerAppName')}
100106
/>
101107
) : null}
102108
{stage === Stage.SecurityPassword ? (
@@ -113,7 +119,7 @@ const AddAccountButton: React.FC<AddAccountButtonProps> = ({ walletId }) => {
113119
<SelectNetworkContent
114120
onSelect={(c) => {
115121
setCrypto(c)
116-
setStage(Stage.SelectAddresses)
122+
setStage(wallet.type === 'ledger' ? Stage.ConnectLedger : Stage.SelectAddresses)
117123
}}
118124
/>
119125
) : null}

components/AssetDistributionChart/ValidatorPopover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const ValidatorPopover: React.FC<ValidatorPopoverProps> = ({
6161
</Box>
6262
<Box p={2} pt={0}>
6363
<Typography variant="body2" color="textSecondary">
64-
{t('total delegated amount')}
64+
{t('total delegation amount')}
6565
</Typography>
6666
<Typography>{formatCurrency(getTokenAmountBalance(balance), currency, lang)}</Typography>
6767
</Box>

components/DelegationDialog/SelectAmount.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const SelectAmount: React.FC<SelectAmountProps> = ({ account, onConfirm, availab
3939
{formatTokenAmount(availableAmount, account.crypto, lang, ', ')}
4040
</b>
4141
</Typography>
42-
<Typography>{t('total delegated amount')}</Typography>
42+
<Typography>{t('total delegation amount')}</Typography>
4343
<TokenAmountInput
4444
value={amount}
4545
denom={denom || ''}

components/DelegationDialog/SelectValidators.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const SelectValidators: React.FC<SelectValidatorsProps> = ({
108108
<DialogContent className={classes.dialogContent}>
109109
<Box ml={4} minHeight={360} maxHeight={600}>
110110
<Typography className={classes.marginBottom}>
111-
{t('total delegated amount')}{' '}
111+
{t('total delegation amount')}{' '}
112112
<b className={classes.marginLeft}>{formatCrypto(amount, denom, lang)}</b>
113113
</Typography>
114114
<Grid container spacing={4}>

components/RedelegateDialog/SelectAmount.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const SelectAmount: React.FC<SelectAmountProps> = ({
5454
<DialogContent className={classes.dialogContent}>
5555
<Box ml={4} minHeight={360} maxHeight={600}>
5656
<Typography className={classes.marginBottom}>
57-
{t('total delegated amount')}{' '}
57+
{t('total delegation amount')}{' '}
5858
<b className={classes.marginLeft}>
5959
{formatTokenAmount(availableAmount, account.crypto, lang, ', ')}
6060
</b>

components/RedelegateDialog/SelectValidators.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const SelectValidators: React.FC<SelectValidatorsProps> = ({
6060
<DialogContent className={classes.dialogContent}>
6161
<Box ml={4} minHeight={360} maxHeight={600}>
6262
<Typography className={classes.marginBottom}>
63-
{t('total delegated amount')}{' '}
63+
{t('total delegation amount')}{' '}
6464
<b className={classes.marginLeft}>{formatCrypto(amount, denom, lang)}</b>
6565
</Typography>
6666
<Grid container spacing={4}>

components/UndelegateDialog/SelectValidators.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const SelectValidators: React.FC<SelectValidatorsProps> = ({
5454
<DialogContent className={classes.dialogContent}>
5555
<Box ml={4} minHeight={360} maxHeight={600}>
5656
<Typography className={classes.marginBottom}>
57-
{t('total delegated amount')}{' '}
57+
{t('total delegation amount')}{' '}
5858
<b className={classes.marginLeft}>
5959
{formatTokenAmount(availableAmount, denom, lang, ', ')}
6060
</b>

locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
"fundActivity": "funded",
159159
"toCommunityPool": "to community pool",
160160
"available amount": "Available amount",
161-
"total delegated amount": "Total Delegated Amount",
161+
"total delegation amount": "Total Delegation Amount",
162162
"delegate to": "Delegate to",
163163
"select validator": "Select validator",
164164
"amount": "Amount",

locales/zh/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
"fundActivity": "[zh] funded",
157157
"toCommunityPool": "[zh] to community pool",
158158
"available amount": "[zh] Available amount",
159-
"total delegated amount": "[zh] Total Delegated Amount",
159+
"total delegation amount": "[zh] total delegation amount",
160160
"delegate to": "[zh] Delegate to",
161161
"select validator": "[zh] Select validator",
162162
"amount": "[zh] Amount",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "forbole-x",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

0 commit comments

Comments
 (0)