Skip to content

Commit

Permalink
Merge branch 'main' into feat/locales-fr
Browse files Browse the repository at this point in the history
  • Loading branch information
jzu authored Aug 7, 2024
2 parents 55d5629 + 0cf23b2 commit 1274e3a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 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
2 changes: 1 addition & 1 deletion src/background/services/balances/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export interface Balances {
};
}

export const CLOUDFLARE_IPFS_URL = 'https://cloudflare-ipfs.com';
export const IPFS_URL = 'https://ipfs.io';

export interface CachedBalancesInfo {
totalBalance?: TotalBalance;
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
4 changes: 2 additions & 2 deletions src/utils/ipsfResolverWithFallback.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ipfsResolver } from '@avalabs/core-utils-sdk';
import { CLOUDFLARE_IPFS_URL } from '@src/background/services/balances/models';
import { IPFS_URL } from '@src/background/services/balances/models';
export function ipfsResolverWithFallback(
sourceUrl: string | undefined,
desiredGatewayPrefix: string = CLOUDFLARE_IPFS_URL
desiredGatewayPrefix: string = IPFS_URL
) {
if (!sourceUrl) {
return '';
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 1274e3a

Please sign in to comment.