Skip to content
This repository was archived by the owner on May 19, 2023. It is now read-only.

Commit 44db960

Browse files
committed
fix(account): displays logged in account with checksum
1 parent c628a5f commit 44db960

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

example/src/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import {
1717
import '@rsksmart/rif-ui/dist/index.css';
1818
import Routes from './Routes';
1919

20-
const requiredNetworkId = 31
21-
const requiredNetworkName = 'RSK Testnet'
20+
const requiredNetworkId = 8545
21+
const requiredNetworkName = 'Localhost 8545'
2222

2323
const App = () => {
2424

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"react": "17.0.1",
6767
"react-dom": "17.0.1",
6868
"react-router-dom": "^5.2.0",
69+
"web3-utils": "^1.3.0",
6970
"web3": "^1.2.8"
7071
},
7172
"engines": {

src/components/organisms/Account.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Web3 from 'web3'
33
import { makeStyles, Theme } from '@material-ui/core/styles'
44
import Popover from '@material-ui/core/Popover'
55
import Typography from '@material-ui/core/Typography'
6+
import { toChecksumAddress } from 'web3-utils'
67
import ProviderInfo, { EProvider } from '../../models/ProviderInfo'
78
import { shortenString } from '../../utils'
89
import { Button, NetworkIndicator } from '../atoms'
@@ -93,9 +94,8 @@ const Account: FC<AccountProps> = (props) => {
9394

9495
if (connectionStatus === ConnectionStatus.WrongNetwork) return 'Wrong Network'
9596

96-
if (account) {
97-
// means connectionStatus === ConnectionStatus.LoggedIn
98-
return shortenString(account)
97+
if (account) { // means connectionStatus === ConnectionStatus.LoggedIn
98+
return shortenString(toChecksumAddress(account))
9999
}
100100
return 'Unlock your wallet'
101101
}

0 commit comments

Comments
 (0)