diff --git a/src/components/admin-lte/configure/servers.js b/src/components/admin-lte/configure/servers.js index 56e335f..40fd1a0 100644 --- a/src/components/admin-lte/configure/servers.js +++ b/src/components/admin-lte/configure/servers.js @@ -21,7 +21,8 @@ class Servers extends React.Component { selectedServer: '', showAddField: false, newServer: '', - inFetch: false + inFetch: false, + currentServer: '' } _this.BchWallet = BchWallet } @@ -90,6 +91,7 @@ class Servers extends React.Component { text='Update' type='primary' className='btn-lg' + disabled={_this.state.selectedServer === _this.state.currentServer} onClick={_this.handleUpdateServer} /> @@ -178,6 +180,7 @@ class Servers extends React.Component { } _this.setState({ selectOptions, + currentServer: walletInfo.selectedServer, selectedServer: walletInfo.selectedServer }) } catch (error) { @@ -207,6 +210,9 @@ class Servers extends React.Component { setTimeout(() => { _this.updateWalletInstance() }, 500) + _this.setState({ + currentServer: _this.state.selectedServer + }) } // Update the wallet instance state diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index 8c4b1a4..4534e8f 100644 --- a/src/components/admin-lte/index.js +++ b/src/components/admin-lte/index.js @@ -405,15 +405,15 @@ class AdminLTEPage extends React.Component { // return if servers configurations exist if (walletInfo.selectedServer) return null - const server1 = 'https://bchn.fullstack.cash/v5/' - const server2 = 'https://abc.fullstack.cash/v5/' + const server1 = 'https://free-bch.fullstack.cash/' + const server2 = 'http://localhost:5005/' const servers = [server1, server2] // Default server is BCHN. - let selectedServer = server1 + const selectedServer = server1 - if (accessLocation === 'wallet.fullstack.cash') { + /* if (accessLocation === 'wallet.fullstack.cash') { selectedServer = server1 } @@ -429,7 +429,7 @@ class AdminLTEPage extends React.Component { // Split uses BCHN by default if (accessLocation === 'splitbch.com') { selectedServer = server1 - } + } */ walletInfo.selectedServer = selectedServer walletInfo.servers = servers diff --git a/src/components/admin-lte/wallet/create.js b/src/components/admin-lte/wallet/create.js index d2d41f3..56f695c 100644 --- a/src/components/admin-lte/wallet/create.js +++ b/src/components/admin-lte/wallet/create.js @@ -139,7 +139,7 @@ class NewWallet extends React.Component { if (_interface === 'consumer-api') { bchjsOptions.interface = _interface - bchjsOptions.restURL = siteConfig.restURL + bchjsOptions.restURL = restURL return bchjsOptions } diff --git a/src/components/admin-lte/wallet/import.js b/src/components/admin-lte/wallet/import.js index 72afb83..b0666fa 100644 --- a/src/components/admin-lte/wallet/import.js +++ b/src/components/admin-lte/wallet/import.js @@ -180,7 +180,7 @@ class ImportWallet extends React.Component { if (_interface === 'consumer-api') { bchjsOptions.interface = _interface - bchjsOptions.restURL = siteConfig.restURL + bchjsOptions.restURL = restURL return bchjsOptions } diff --git a/src/redux/createStore.js b/src/redux/createStore.js index 932d186..467f8a5 100644 --- a/src/redux/createStore.js +++ b/src/redux/createStore.js @@ -102,7 +102,7 @@ const getBchjsOptions = () => { if (_interface === 'consumer-api') { bchjsOptions.interface = _interface - bchjsOptions.restURL = siteConfig.restURL + bchjsOptions.restURL = restURL return bchjsOptions }