1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Make _setProviderConfig async (#18600)

The network controller internal method `_setProviderConfig` has been
made async, the async `_switchNetwork` operation is now `await`-ed.

Since the `_switchNetwork` call was the last operation, this has zero
functional impact.

Relates to https://github.com/MetaMask/metamask-extension/issues/18587
This commit is contained in:
Mark Stacey 2023-04-14 19:10:32 -02:30 committed by GitHub
parent b9ff4e8798
commit e6d1b052f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -866,10 +866,10 @@ export class NetworkController extends EventEmitter {
*
* @param providerConfig - The provider configuration.
*/
_setProviderConfig(providerConfig: ProviderConfiguration): void {
async _setProviderConfig(providerConfig: ProviderConfiguration) {
this.#previousProviderConfig = this.providerStore.getState();
this.providerStore.putState(providerConfig);
this._switchNetwork(providerConfig);
await this._switchNetwork(providerConfig);
}
/**