Skip to content

Commit

Permalink
Merge pull request #35 from Cerebellum-Network/release/0.17.0
Browse files Browse the repository at this point in the history
Release/0.17.0
  • Loading branch information
DmitriyMolch authored Aug 2, 2022
2 parents 995eee1 + ff213ac commit 25d3e39
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# CHANGELOG

## vNext
- ...
...

## 0.17.0
- Updated Cere Blockchain public URLs
- Fixed getting cached app settings from local storage

## 0.16.1
- Reverted Cere QAnet renaming
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/endpoints/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function createProduction (t: TFunction): LinkOption[] {
info: 'cere',
text: t('rpc.cere', 'Cere Mainnet', { ns: 'apps-config' }),
providers: {
'Cere Network': 'wss://archive.v2.mainnet.cere.network/ws',
'Cere Network': 'wss://archive.mainnet.cere.network/ws',
'Republic Crypto': 'wss://cere-archive.centrifuge.labs.republiccrypto.com:444',
}
},
Expand Down
6 changes: 3 additions & 3 deletions packages/apps-config/src/endpoints/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ export function createTesting (t: TFunction): LinkOption[] {
info: 'cere',
text: t('rpc.cere', 'Cere Testnet', { ns: 'apps-config' }),
providers: {
'Cere Network': 'wss://archive.v2.testnet.cere.network/ws'
'Cere Network': 'wss://archive.testnet.cere.network/ws'
}
},
{
info: 'cere',
text: t('rpc.cere', 'Cere QAnet', { ns: 'apps-config' }),
providers: {
'Cere Network': 'wss://archive.v2.qanet.cere.network/ws'
'Cere Network': 'wss://archive.qanet.cere.network/ws'
}
},
{
info: 'cere',
text: t('rpc.cere', 'Cere Devnet', { ns: 'apps-config' }),
providers: {
'Cere Network': 'wss://archive.v2.devnet.cere.network/ws'
'Cere Network': 'wss://archive.devnet.cere.network/ws'
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions packages/apps/src/initSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0

import queryString from 'query-string';
import store from 'store';

import { createWsEndpoints } from '@polkadot/apps-config';
import { extractIpfsDetails } from '@polkadot/react-hooks/useIpfs';
Expand Down Expand Up @@ -57,11 +56,12 @@ function getApiUrl (): string {
}
}

const stored = store.get('settings') as Record<string, unknown> || {};
const fallbackUrl = endpoints.find(({ value }) => !!value);

// via settings, or the default chain
return [stored.apiUrl, process.env.WS_URL].includes(settings.apiUrl)
const urls = endpoints.map((endpoint) => endpoint.value).filter((url) => !!url);

return [...urls, process.env.WS_URL].includes(settings.apiUrl)
? settings.apiUrl // keep as-is
: fallbackUrl
? fallbackUrl.value as string // grab the fallback
Expand Down

0 comments on commit 25d3e39

Please sign in to comment.