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() {
if (this.state.addNodeCoin) {
if (this.state.addNodeCoin && this.state.addPeerIP) {
Store.dispatch(
addPeerNode(
this.state.addNodeCoin.split('|')[0],
@ -89,29 +89,9 @@ class AddNodePanel extends React.Component {
}
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({
[e.target.name]: e.target.value,
});
}
}
render() {
@ -145,11 +125,11 @@ class AddNodePanel extends React.Component {
<h5>
SuperNET Peers:
</h5>
<p>{ this.renderSNPeersList() }</p>
<div>{ this.renderSNPeersList() }</div>
<h5>
Raw Peers:
</h5>
<p>{ this.renderPeersList() }</p>
<div>{ this.renderPeersList() }</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));
}
updateInput(e) {
updateInput = (e) => {
this.setState({
[e.target.name]: e.target.value,
});

Loading…
Cancel
Save