Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 committed Feb 16, 2024
1 parent 068a667 commit 6fdee42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export const createQueuedRequestMiddleware = ({
QueuedRequestControllerActionTypes.enqueueRequest,
async () => {
if (
// TODO should this list include wallet_requestPermissions/requestAccounts
req.method === 'wallet_switchEthereumChain' ||
req.method === 'wallet_addEthereumChain'
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ export class SelectedNetworkController extends BaseController<
this.messagingSystem.subscribe(
'NetworkController:stateChange',
({ selectedNetworkClientId }) => {
this.setNetworkClientIdForMetamask(selectedNetworkClientId);
if (this.getNetworkClientIdForMetamask() !== selectedNetworkClientId) {
this.setNetworkClientIdForMetamask(selectedNetworkClientId);
}
},
);
}
Expand Down Expand Up @@ -204,7 +206,7 @@ export class SelectedNetworkController extends BaseController<
});
}

domainHasPermissions(domain: Domain): boolean {
#domainHasPermissions(domain: Domain): boolean {
return this.messagingSystem.call(
'PermissionController:hasPermissions',
domain,
Expand All @@ -221,7 +223,7 @@ export class SelectedNetworkController extends BaseController<
}

// Check and, if not a metamask request, return early if the domain lacks permissions
if (domain !== METAMASK_DOMAIN && !this.domainHasPermissions(domain)) {
if (domain !== METAMASK_DOMAIN && !this.#domainHasPermissions(domain)) {
return;
}

Expand Down

0 comments on commit 6fdee42

Please sign in to comment.