mirror of
https://github.com/fullstack-cash/fullstack-gatsby-theme-bch-wallet.git
synced 2026-09-21 16:52:06 -07:00
fix(server): Fixed Refreshing forgets new server
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
</Box>
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ const getBchjsOptions = () => {
|
||||
|
||||
if (_interface === 'consumer-api') {
|
||||
bchjsOptions.interface = _interface
|
||||
bchjsOptions.restURL = siteConfig.restURL
|
||||
bchjsOptions.restURL = restURL
|
||||
return bchjsOptions
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user