Skip to content

Commit

Permalink
Merge branch 'main' into fix/CP-8558
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanml authored Aug 6, 2024
2 parents d541e90 + 00c212b commit 252847f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ jobs:
name: extension
path: extension.zip
e2e:
runs-on: ubuntu-latest-16-cores-core-extension
needs: build
name: Run E2E Smoke Tests
runs-on: ubuntu-latest-16-cores
environment: e2e
env:
RUNNER: CI
Expand Down
13 changes: 11 additions & 2 deletions src/background/services/network/NetworkService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ export class NetworkService implements OnLock, OnStorageReady {
// At this point the chainlist from Glacier should already be available,
// as it is fetched when service worker starts (so before extension is unlocked).
// If it isn't available yet, we'll use the list cached in the storage.
const chainlist = await Promise.race([

const chainlist = await Promise.any([
this._chainListFetched.promisify(),
this._getCachedChainList(),
]);
Expand Down Expand Up @@ -358,7 +359,15 @@ export class NetworkService implements OnLock, OnStorageReady {
}

private async _getCachedChainList(): Promise<ChainList | undefined> {
return this.storageService.load<ChainList>(NETWORK_LIST_STORAGE_KEY);
const networkList = await this.storageService.load<ChainList>(
NETWORK_LIST_STORAGE_KEY
);

if (!networkList) {
throw new Error('No networks cached');
}

return networkList;
}

private _getPchainNetwork(isTestnet: boolean): Network {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sourceMap": true,
"jsx": "react-jsx",
"esModuleInterop": true,
"lib": ["es2015", "dom"],
"lib": ["es2015", "es2021", "dom"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"allowSyntheticDefaultImports": true,
Expand Down

0 comments on commit 252847f

Please sign in to comment.