diff --git a/frontend/src/lib/services/app.services.ts b/frontend/src/lib/services/app.services.ts index c759abe3f68..42a16776a95 100644 --- a/frontend/src/lib/services/app.services.ts +++ b/frontend/src/lib/services/app.services.ts @@ -11,17 +11,18 @@ export const initAppPrivateData = async (): Promise => { // Reload the SNS projects even if they were loaded. // Get latest data and create wrapper caches for the logged in identity. const initSns: Promise[] = [loadSnsProjects()]; - const initImportedTokens: Promise[] = get(ENABLE_IMPORT_TOKEN) - ? [loadImportedTokens()] - : []; // TODO: load imported tokens after Nns. /** * If Nns load but ImportedTokens or Sns load fails it is "fine" to go on because Nns are core features. */ await Promise.allSettled([ - Promise.all(initNns), - Promise.all(initImportedTokens), + Promise.all(initNns).then(() => + // When you log in with a new account for the first time, the account is created in the NNS dapp. + // If you request imported tokens before the account is created, an `AccountNotFound` error will be thrown. + // To avoid this, the imported tokens should only be requested after the NNS accounts have been initialized. + Promise.all(get(ENABLE_IMPORT_TOKEN) ? [loadImportedTokens()] : []) + ), Promise.all(initSns), ]);