@@ -68,7 +68,6 @@ const InputDisplay: React.FC<IInputDisplay> = ({
6868 setAmount,
6969} ) => {
7070 const [ debouncedAmount , setDebouncedAmount ] = useState ( "" ) ;
71- const [ hasInteracted , setHasInteracted ] = useState ( false ) ;
7271 const [ errorMsg , setErrorMsg ] = useState < string | undefined > ( ) ;
7372 useDebounce ( ( ) => setDebouncedAmount ( amount ) , 500 , [ amount ] ) ;
7473 const parsedAmount = useParsedAmount ( uncommify ( debouncedAmount ) as `${number } `) ;
@@ -90,7 +89,7 @@ const InputDisplay: React.FC<IInputDisplay> = ({
9089 const isStaking = useMemo ( ( ) => action === ActionType . stake , [ action ] ) ;
9190
9291 useEffect ( ( ) => {
93- if ( ! hasInteracted || parsedAmount === 0n ) {
92+ if ( parsedAmount === 0n ) {
9493 setErrorMsg ( undefined ) ;
9594 } else if ( isStaking && balance && parsedAmount > balance ) {
9695 setErrorMsg ( "Insufficient balance to stake this amount" ) ;
@@ -99,7 +98,7 @@ const InputDisplay: React.FC<IInputDisplay> = ({
9998 } else {
10099 setErrorMsg ( undefined ) ;
101100 }
102- } , [ hasInteracted , parsedAmount , isStaking , balance , jurorBalance ] ) ;
101+ } , [ parsedAmount , isStaking , balance , jurorBalance ] ) ;
103102
104103 return (
105104 < >
@@ -109,7 +108,6 @@ const InputDisplay: React.FC<IInputDisplay> = ({
109108 onClick = { ( ) => {
110109 const amount = isStaking ? parsedBalance : parsedStake ;
111110 setAmount ( amount ) ;
112- setHasInteracted ( true ) ;
113111 } }
114112 >
115113 { isStaking ? "Stake" : "Withdraw" } all
@@ -121,7 +119,6 @@ const InputDisplay: React.FC<IInputDisplay> = ({
121119 value = { uncommify ( amount ) }
122120 onChange = { ( e ) => {
123121 setAmount ( e ) ;
124- setHasInteracted ( true ) ;
125122 } }
126123 placeholder = { isStaking ? "Amount to stake" : "Amount to withdraw" }
127124 message = { errorMsg ?? undefined }
@@ -137,9 +134,6 @@ const InputDisplay: React.FC<IInputDisplay> = ({
137134 isSending,
138135 setIsSending,
139136 setIsPopupOpen,
140- setErrorMsg,
141- hasInteracted,
142- setHasInteracted,
143137 } }
144138 />
145139 </ EnsureChainContainer >
0 commit comments