mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
fix misuse of getCurrentNetwork (#10504)
This commit is contained in:
parent
88c50edad3
commit
aaec480e32
@ -22,7 +22,7 @@ async function addEthereumChainHandler(
|
||||
end,
|
||||
{
|
||||
addCustomRpc,
|
||||
getCurrentNetwork,
|
||||
getCurrentChainId,
|
||||
findCustomRpcBy,
|
||||
updateRpcTarget,
|
||||
requestUserApproval,
|
||||
@ -122,8 +122,8 @@ async function addEthereumChainHandler(
|
||||
const existingNetwork = findCustomRpcBy({ chainId: _chainId });
|
||||
|
||||
if (existingNetwork !== null) {
|
||||
const currentNetwork = getCurrentNetwork();
|
||||
if (currentNetwork.chainId === _chainId) {
|
||||
const currentChainId = getCurrentChainId();
|
||||
if (currentChainId === _chainId) {
|
||||
res.result = null;
|
||||
return end();
|
||||
}
|
||||
|
@ -2111,7 +2111,9 @@ export default class MetamaskController extends EventEmitter {
|
||||
this.alertController,
|
||||
),
|
||||
findCustomRpcBy: this.findCustomRpcBy.bind(this),
|
||||
getCurrentNetwork: this.getCurrentNetwork.bind(this),
|
||||
getCurrentChainId: this.networkController.getCurrentChainId.bind(
|
||||
this.networkController,
|
||||
),
|
||||
requestUserApproval: this.approvalController.addAndShowApprovalRequest.bind(
|
||||
this.approvalController,
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user