Skip to content

Commit

Permalink
save empty array if SPV Connect field has been cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
bgptr committed Sep 30, 2023
1 parent 391d8a5 commit 3de61e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ const NetworkSettings = ({ tempSettings, onChangeTempSettings }) => (
value={tempSettings.spvConnect}
disabled={tempSettings.spvConnectFromCli}
ariaLabelledBy="spv-connect-input"
onChange={(value) =>
onChangeTempSettings({ spvConnect: value.split(",") })
}
onChange={(value) => {
onChangeTempSettings({
spvConnect: value ? value.split(",") : []
});
}}
/>
</SettingsInputWrapper>
</div>
Expand Down
8 changes: 8 additions & 0 deletions test/unit/components/views/SettingsPage/SettingsPage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,14 @@ test.each([
testSpvConnectValue.join(","),
{ spvConnect: testSpvConnectValue },
false
],
[
// clear input field
"SPV Connect",
testDefaultSpvConnectValue.join(","),
"",
{ spvConnect: [] },
false
]
])("change '%s' TextInput from '%s' to '%s' expeced %s", testTextFieldInput);

Expand Down

0 comments on commit 3de61e8

Please sign in to comment.