Skip to content

Commit d761ac8

Browse files
committed
Auto-refresh network controller during initialization
1 parent 2ccecd7 commit d761ac8

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/AccountTrackerController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export class AccountTrackerController extends BaseController<AccountTrackerConfi
8989
super.onComposed();
9090
const preferences = this.context.PreferencesController as PreferencesController;
9191
preferences.subscribe(this.refresh);
92+
this.refresh();
9293
}
9394

9495
/**

src/NetworkController.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export class NetworkController extends BaseController<NetworkConfig, NetworkStat
140140
provider: { type: 'rinkeby' }
141141
};
142142
this.initialize();
143+
this.refreshNetwork();
143144
}
144145

145146
/**
@@ -159,6 +160,7 @@ export class NetworkController extends BaseController<NetworkConfig, NetworkStat
159160
* Refreshes the current network code
160161
*/
161162
lookupNetwork() {
163+
/* istanbul ignore if */
162164
if (!this.ethQuery || !this.ethQuery.sendAsync) {
163165
return;
164166
}

0 commit comments

Comments
 (0)