Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix: persist custom neutrino nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Feb 17, 2023
1 parent c0f6f26 commit 752ba06
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion renderer/components/Home/WalletSettingsFormLocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const sanitizeNeutrinoNodes = nodes =>
export const validateNeutrinoNodes = async formApi => {
const field = 'neutrinoNodes'
const value = sanitizeNeutrinoNodes(formApi.getValue(field))

if (!value) {
return
}
Expand Down Expand Up @@ -49,6 +50,10 @@ export const validateNeutrinoNodes = async formApi => {

// informed parser for neutrinoNodes field
const parseNeutrinoNodes = value => {
if (!value) {
return []
}

if (Array.isArray(value)) {
return value
}
Expand Down Expand Up @@ -97,6 +102,7 @@ class WalletSettingsFormLocal extends React.Component {
autopilotMinchansize,
autopilotMaxchansize,
autopilotAllocation,
neutrinoNodes,
} = wallet

return (
Expand Down Expand Up @@ -181,7 +187,8 @@ class WalletSettingsFormLocal extends React.Component {
field="neutrinoNodes"
format={formatNeutrinoNodes}
highlightOnValid={false}
initialValue={config.lnd.neutrino[chain][network]}
id="neutrinoNodes"
initialValue={neutrinoNodes || config.lnd.neutrino[chain][network]}
onBlur={this.validateHost}
onChange={this.validateHost}
parse={parseNeutrinoNodes}
Expand Down

0 comments on commit 752ba06

Please sign in to comment.