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:
ekzyis 2024-07-05 19:17:28 +02:00
parent 55928ac252
commit 8acf74c787
1 changed files with 4 additions and 1 deletions

View File

@ -22,11 +22,14 @@ export default function WalletSettings () {
const wallet = useWallet(name)
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 {
...acc,
[field.name]: wallet.config?.[field.name] || ''
}
}, wallet.server ? wallet.config.autowithdrawSettings : {})
}, wallet.config)
return (
<CenterLayout>