File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { StateWithDispatch } from 'states/stateProvider/reducer'
2020import { useLocalDescription } from 'utils/hooks'
2121import { localNumberFormatter , shannonToCKBFormatter } from 'utils/formatters'
2222import { onRenderRow } from 'utils/fabricUIRender'
23+ import { MAINNET_TAG } from 'utils/const'
2324
2425const Addresses = ( {
2526 app : {
@@ -30,8 +31,7 @@ const Addresses = ({
3031 settings : { networks = [ ] } ,
3132 dispatch,
3233} : React . PropsWithoutRef < StateWithDispatch & RouteComponentProps > ) => {
33- const isMainnet =
34- ( networks . find ( n => n . id === networkID ) || { } ) . chain === ( process . env . REACT_APP_MAINNET_TAG || 'ckb' )
34+ const isMainnet = ( networks . find ( n => n . id === networkID ) || { } ) . chain === MAINNET_TAG
3535 const [ showMainnetAddress , setShowMainnetAddress ] = useState ( false )
3636 const [ t ] = useTranslation ( )
3737
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { ckbCore } from 'services/chain'
88import { transactionState } from 'states/initStates/chain'
99
1010import { localNumberFormatter , uniformTimeFormatter , shannonToCKBFormatter } from 'utils/formatters'
11- import { ErrorCode } from 'utils/const'
11+ import { ErrorCode , MAINNET_TAG } from 'utils/const'
1212import { explorerNavButton } from './style.module.scss'
1313
1414const MIN_CELL_WIDTH = 70
@@ -199,9 +199,7 @@ const Transaction = () => {
199199 }
200200
201201 setAddressPrefix (
202- network . chain === process . env . REACT_APP_MAINNET_TAG
203- ? ckbCore . utils . AddressPrefix . Mainnet
204- : ckbCore . utils . AddressPrefix . Testnet
202+ network . chain === MAINNET_TAG ? ckbCore . utils . AddressPrefix . Mainnet : ckbCore . utils . AddressPrefix . Testnet
205203 )
206204 }
207205 } )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export const UNREMOVABLE_NETWORK_ID = '0'
1010export const CONFIRMATION_THRESHOLD = 30
1111
1212export const MAX_DECIMAL_DIGITS = 8
13+ export const MAINNET_TAG = 'ckb'
1314
1415export enum ConnectionStatus {
1516 Online = 'online' ,
You can’t perform that action at this time.
0 commit comments