@@ -1346,9 +1346,6 @@ export class SnapController extends BaseController<
13461346 * runnable Snaps.
13471347 */
13481348 init ( ) {
1349- // Lazily populate the `isReady` state.
1350- this . #ensureCanUsePlatform( ) . catch ( logWarning ) ;
1351-
13521349 this . #setup( ) . catch ( ( error ) => {
13531350 logError ( 'Error during SnapController initialization.' , error ) ;
13541351 } ) ;
@@ -1369,6 +1366,8 @@ export class SnapController extends BaseController<
13691366 await this . #handlePreinstalledSnaps( this . #preinstalledSnaps) ;
13701367 }
13711368
1369+ await this . #platformIsReady( ) ;
1370+
13721371 this . #controllerSetup. resolve ( ) ;
13731372 } catch ( error ) {
13741373 this . #controllerSetup. reject ( error ) ;
@@ -1765,11 +1764,15 @@ export class SnapController extends BaseController<
17651764 * Waits for onboarding and then asserts whether the Snaps platform is allowed to run.
17661765 */
17671766 async #ensureCanUsePlatform( ) {
1768- // Ensure the user has onboarded before allowing access to Snaps.
1769- await this . #ensureOnboardingComplete( ) ;
1767+ await this . #platformIsReady( ) ;
17701768
17711769 // Ensure the controller has finished setting up.
17721770 await this . #controllerSetup. promise ;
1771+ }
1772+
1773+ async #platformIsReady( ) {
1774+ // Ensure the user has onboarded before allowing access to Snaps.
1775+ await this . #ensureOnboardingComplete( ) ;
17731776
17741777 const flags = this . #getFeatureFlags( ) ;
17751778
0 commit comments