Browse Source

Check that peerIP is filled, fix import keys update input function

all-modes
Miika Turunen 7 years ago
parent
commit
15dd26fae9
  1. 26
      react/src/components/dashboard/settings/settings.addNodePanel.js
  2. 2
      react/src/components/dashboard/settings/settings.importKeysPanel.js

26
react/src/components/dashboard/settings/settings.addNodePanel.js

@ -78,7 +78,7 @@ class AddNodePanel extends React.Component {
} }
addNode() { addNode() {
if (this.state.addNodeCoin) { if (this.state.addNodeCoin && this.state.addPeerIP) {
Store.dispatch( Store.dispatch(
addPeerNode( addPeerNode(
this.state.addNodeCoin.split('|')[0], this.state.addNodeCoin.split('|')[0],
@ -89,30 +89,10 @@ class AddNodePanel extends React.Component {
} }
updateInput(e) { updateInput(e) {
if (e.target.name === 'wifkeysPassphrase') {
// remove any empty chars from the start/end of the string
const newValue = e.target.value;
clearTimeout(this.state.trimPassphraseTimer);
const _trimPassphraseTimer = setTimeout(() => {
this.setState({
wifkeysPassphrase: newValue ? newValue.trim() : '', // hardcoded field name
});
}, 2000);
this.resizeLoginTextarea();
this.setState({
trimPassphraseTimer: _trimPassphraseTimer,
[e.target.name]: newValue,
});
} else {
this.setState({ this.setState({
[e.target.name]: e.target.value, [e.target.name]: e.target.value,
}); });
} }
}
render() { render() {
return ( return (
@ -145,11 +125,11 @@ class AddNodePanel extends React.Component {
<h5> <h5>
SuperNET Peers: SuperNET Peers:
</h5> </h5>
<p>{ this.renderSNPeersList() }</p> <div>{ this.renderSNPeersList() }</div>
<h5> <h5>
Raw Peers: Raw Peers:
</h5> </h5>
<p>{ this.renderPeersList() }</p> <div>{ this.renderPeersList() }</div>
</div> </div>
</div> </div>

2
react/src/components/dashboard/settings/settings.importKeysPanel.js

@ -18,7 +18,7 @@ class ImportKeysPanel extends React.Component {
Store.dispatch(importPrivKey(this.state.importWifKey)); Store.dispatch(importPrivKey(this.state.importWifKey));
} }
updateInput(e) { updateInput = (e) => {
this.setState({ this.setState({
[e.target.name]: e.target.value, [e.target.name]: e.target.value,
}); });

Loading…
Cancel
Save