From 752ba0646131f3401f26d4c53554d8ae34f56b63 Mon Sep 17 00:00:00 2001 From: mrfelton Date: Fri, 17 Feb 2023 09:53:17 +0100 Subject: [PATCH] fix: persist custom neutrino nodes --- renderer/components/Home/WalletSettingsFormLocal.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/renderer/components/Home/WalletSettingsFormLocal.js b/renderer/components/Home/WalletSettingsFormLocal.js index 583d0868b4b..f2eb58a6a09 100644 --- a/renderer/components/Home/WalletSettingsFormLocal.js +++ b/renderer/components/Home/WalletSettingsFormLocal.js @@ -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 } @@ -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 } @@ -97,6 +102,7 @@ class WalletSettingsFormLocal extends React.Component { autopilotMinchansize, autopilotMaxchansize, autopilotAllocation, + neutrinoNodes, } = wallet return ( @@ -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}