@@ -11,6 +11,7 @@ import NamadaLogo from '../../../assets/masp/namada_logo.svg';
11
11
import ShieldedNamadaLogo from '../../../assets/masp/namada_shielded.svg' ;
12
12
import { makeStyles } from '@material-ui/core/styles' ;
13
13
import variables from '../../../utils/variables' ;
14
+ import { config } from '../../../config' ;
14
15
15
16
const useStyles = makeStyles ( ( theme ) => ( {
16
17
root : {
@@ -79,6 +80,21 @@ const FeeOptions = (props) => {
79
80
: null ;
80
81
81
82
let balanceAmount = Number ( matchingBalance ?. minDenomAmount || 0 ) ;
83
+ if ( matchingToken . address === config . TOKEN_ADDRESS && ! balanceAmount ) {
84
+ let balance = null ;
85
+ props . balance && props . balance . length && props . balance . map ( ( val ) => {
86
+ if ( val && val . length ) {
87
+ val . map ( ( value ) => {
88
+ if ( value === config . TOKEN_ADDRESS ) {
89
+ balance = val [ 1 ] ;
90
+ }
91
+ } ) ;
92
+ }
93
+
94
+ return null ;
95
+ } ) ;
96
+ balanceAmount = balanceAmount || balance ;
97
+ }
82
98
if ( props . from && props . from === 'shielded' ) {
83
99
const matchingBalance = matchingToken
84
100
? ( props . shieldedBalance || [ ] ) . find ( ( [ address ] ) => address === matchingToken . address )
@@ -149,6 +165,7 @@ const FeeOptions = (props) => {
149
165
}
150
166
151
167
FeeOptions . propTypes = {
168
+ balance : PropTypes . array . isRequired ,
152
169
balanceList : PropTypes . array . isRequired ,
153
170
lang : PropTypes . string . isRequired ,
154
171
setFeeOptionPopoverValue : PropTypes . func . isRequired ,
@@ -164,6 +181,7 @@ FeeOptions.propTypes = {
164
181
165
182
const stateToProps = ( state ) => {
166
183
return {
184
+ balance : state . accounts . balance . result ,
167
185
balanceList : state . accounts . balanceList . result ,
168
186
shieldedBalance : state . accounts . shieldedBalance . result ,
169
187
lang : state . language ,
0 commit comments