Fix autowithdrawSettings not applied
Form requires config in flat format but mutation requires autowithdraw settings in a separate 'settings' field. I have decided that config will be in flat form format. It will be transformed into mutation format during save.
This commit is contained in:
parent
55928ac252
commit
8acf74c787
|
@ -22,11 +22,14 @@ export default function WalletSettings () {
|
||||||
const wallet = useWallet(name)
|
const wallet = useWallet(name)
|
||||||
|
|
||||||
const initial = wallet.fields.reduce((acc, field) => {
|
const initial = wallet.fields.reduce((acc, field) => {
|
||||||
|
// we still need to run over all wallet fields via reduce
|
||||||
|
// even though we use wallet.config as the initial value
|
||||||
|
// since wallet.config is empty when wallet is not configured
|
||||||
return {
|
return {
|
||||||
...acc,
|
...acc,
|
||||||
[field.name]: wallet.config?.[field.name] || ''
|
[field.name]: wallet.config?.[field.name] || ''
|
||||||
}
|
}
|
||||||
}, wallet.server ? wallet.config.autowithdrawSettings : {})
|
}, wallet.config)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CenterLayout>
|
<CenterLayout>
|
||||||
|
|
Loading…
Reference in New Issue