File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/grant-explorer/src/features/round Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ export function DonateToGitcoinProvider({
98
98
} : {
99
99
children : React . ReactNode ;
100
100
} ) {
101
- const [ isEnabled , setIsEnabled ] = useState ( true ) ;
102
101
const [ selectedChainId , setSelectedChainId ] = useState < number | null > ( null ) ;
102
+ const [ isEnabled , setIsEnabled ] = useState ( false ) ;
103
103
const [ selectedToken , setSelectedToken ] = useState ( "" ) ;
104
104
const [ amount , setAmount ] = useState ( "0.00" ) ;
105
105
const [ directAllocationPoolId , setDirectAllocationPoolId ] = useState <
@@ -197,6 +197,17 @@ export function DonateToGitcoinProvider({
197
197
fetchBalances ( ) ;
198
198
} , [ address , tokenFilters ] ) ;
199
199
200
+ useEffect ( ( ) => {
201
+ if ( tokenFilters ) {
202
+ const hasGitcoinSupportedChain = tokenFilters . some ( ( filter ) =>
203
+ Object . keys ( GITCOIN_RECIPIENT_CONFIG ) . includes (
204
+ filter . chainId . toString ( )
205
+ )
206
+ ) ;
207
+ setIsEnabled ( hasGitcoinSupportedChain ) ;
208
+ }
209
+ } , [ tokenFilters ] ) ;
210
+
200
211
useEffect ( ( ) => {
201
212
if ( ! isEnabled ) {
202
213
setSelectedChainId ( null ) ;
You can’t perform that action at this time.
0 commit comments