From 87066a783652cbb4b052727a50ea2200ee3303ea Mon Sep 17 00:00:00 2001 From: Jyoti Puri Date: Thu, 24 Oct 2024 16:14:54 +0530 Subject: [PATCH 1/2] Fix enabling EIP-1559 support --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index 4d0f1279..002fa9d9 100644 --- a/src/index.js +++ b/src/index.js @@ -715,6 +715,8 @@ export const handleNewAccounts = (newAccounts) => { gasPriceDiv.style.display = 'block'; maxFeeDiv.style.display = 'none'; maxPriorityDiv.style.display = 'none'; + + handleEIP1559Support(); }; let chainIdInt; From 43a96d25db6de69844081a348d9598e820c79927 Mon Sep 17 00:00:00 2001 From: Jyoti Puri Date: Thu, 24 Oct 2024 16:22:30 +0530 Subject: [PATCH 2/2] Fix enabling EIP-1559 support --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 002fa9d9..800329ea 100644 --- a/src/index.js +++ b/src/index.js @@ -787,6 +787,10 @@ const getNetworkAndChainId = async () => { }; const handleEIP1559Support = async () => { + if (!Array.isArray(accounts) || accounts.length <= 0) { + return; + } + const block = await provider.request({ method: 'eth_getBlockByNumber', params: ['latest', false], @@ -794,7 +798,7 @@ const handleEIP1559Support = async () => { const supported = block.baseFeePerGas !== undefined; - if (supported && Array.isArray(accounts) && accounts.length >= 1) { + if (supported) { sendEIP1559Button.disabled = false; sendEIP1559Button.hidden = false; sendEIP1559WithoutGasButton.disabled = false;