File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -715,6 +715,8 @@ export const handleNewAccounts = (newAccounts) => {
715715 gasPriceDiv . style . display = 'block' ;
716716 maxFeeDiv . style . display = 'none' ;
717717 maxPriorityDiv . style . display = 'none' ;
718+
719+ handleEIP1559Support ( ) ;
718720} ;
719721
720722let chainIdInt ;
@@ -785,14 +787,18 @@ const getNetworkAndChainId = async () => {
785787} ;
786788
787789const handleEIP1559Support = async ( ) => {
790+ if ( ! Array . isArray ( accounts ) || accounts . length <= 0 ) {
791+ return ;
792+ }
793+
788794 const block = await provider . request ( {
789795 method : 'eth_getBlockByNumber' ,
790796 params : [ 'latest' , false ] ,
791797 } ) ;
792798
793799 const supported = block . baseFeePerGas !== undefined ;
794800
795- if ( supported && Array . isArray ( accounts ) && accounts . length >= 1 ) {
801+ if ( supported ) {
796802 sendEIP1559Button . disabled = false ;
797803 sendEIP1559Button . hidden = false ;
798804 sendEIP1559WithoutGasButton . disabled = false ;
You can’t perform that action at this time.
0 commit comments