1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

fix version component Spree detection

This commit is contained in:
Matthias Kretschmann 2019-07-18 14:10:45 +02:00
parent 6fe55e7a81
commit 16783bc7da
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -42,10 +42,16 @@ export default class VersionNumbers extends PureComponent<
// construct values which are not part of any response
public commonsVersion =
process.env.NODE_ENV === 'production' ? version : `${version}-dev`
public commonsNetwork = new URL(nodeUri).hostname.split('.')[0]
public commonsNetwork = faucetUri.includes('localhost')
? 'Spree'
: new URL(nodeUri).hostname.split('.')[0]
public faucetNetwork = faucetUri.includes('dev-ocean')
? new URL(faucetUri).hostname.split('.')[1]
: 'Pacific'
: faucetUri.includes('oceanprotocol.com')
? 'Pacific'
: faucetUri.includes('localhost')
? 'Spree'
: 'Unknown'
// define a minimal default state to fill UI
public state: VersionNumbersState = {