Merge pull request #1499 from stackernews/fix-wallet-save

Fix wallet client validation
This commit is contained in:
Keyan 2024-10-19 20:22:22 -05:00 committed by GitHub
commit f5ebd573d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -125,7 +125,8 @@ function extractConfig (fields, config, client) {
const field = fields.find(({ name }) => name === key)
// filter server config which isn't specified as wallet fields
if (client && (key.startsWith('autoWithdraw') || key === 'id')) return acc
// (we allow autowithdraw members to pass validation)
if (client && key === 'id') return acc
// field might not exist because config.enabled doesn't map to a wallet field
if (!field || (client ? isClientField(field) : isServerField(field))) {
@ -198,6 +199,9 @@ function useConfig (wallet) {
if (transformedConfig) {
newClientConfig = Object.assign(newClientConfig, transformedConfig)
}
// these are stored on the server
delete newClientConfig.autoWithdrawMaxFeePercent
delete newClientConfig.autoWithdrawMaxFeeTotal
} catch {
valid = false
}