Skip to content

Commit

Permalink
Cherry pick: Fix issue where per dapp selected network state is enabl…
Browse files Browse the repository at this point in the history
…ed without the request queue experimental toggle enabled

**Description**
Cherry pick of this code:
#21946
  • Loading branch information
adonesky1 committed Nov 22, 2023
1 parent 6d00e61 commit 919e9b2
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,6 @@ export default class MetamaskController extends EventEmitter {
}),
});

// turn on perDappSelectedNetwork feature flag
this.selectedNetworkController.update((state) => {
state.perDomainNetwork = true;
});

this.tokenListController = new TokenListController({
chainId: this.networkController.state.providerConfig.chainId,
preventPollingOnNetworkRestart: initState.TokenListController
Expand Down Expand Up @@ -2531,9 +2526,7 @@ export default class MetamaskController extends EventEmitter {
preferencesController,
),
///: END:ONLY_INCLUDE_IN
setUseRequestQueue: preferencesController.setUseRequestQueue.bind(
preferencesController,
),
setUseRequestQueue: this.setUseRequestQueue.bind(this),
setIpfsGateway: preferencesController.setIpfsGateway.bind(
preferencesController,
),
Expand Down Expand Up @@ -4007,6 +4000,17 @@ export default class MetamaskController extends EventEmitter {
this.sendUpdate();
}

//=============================================================================
// REQUEST QUEUE
//=============================================================================

setUseRequestQueue(value) {
this.preferencesController.setUseRequestQueue(value);
this.selectedNetworkController.update((state) => {
state.perDomainNetwork = value;
});
}

//=============================================================================
// SETUP
//=============================================================================
Expand Down

0 comments on commit 919e9b2

Please sign in to comment.