Merge pull request #1499 from stackernews/fix-wallet-save
Fix wallet client validation
This commit is contained in:
commit
f5ebd573d6
@ -125,7 +125,8 @@ function extractConfig (fields, config, client) {
|
|||||||
const field = fields.find(({ name }) => name === key)
|
const field = fields.find(({ name }) => name === key)
|
||||||
|
|
||||||
// filter server config which isn't specified as wallet fields
|
// 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
|
// field might not exist because config.enabled doesn't map to a wallet field
|
||||||
if (!field || (client ? isClientField(field) : isServerField(field))) {
|
if (!field || (client ? isClientField(field) : isServerField(field))) {
|
||||||
@ -198,6 +199,9 @@ function useConfig (wallet) {
|
|||||||
if (transformedConfig) {
|
if (transformedConfig) {
|
||||||
newClientConfig = Object.assign(newClientConfig, transformedConfig)
|
newClientConfig = Object.assign(newClientConfig, transformedConfig)
|
||||||
}
|
}
|
||||||
|
// these are stored on the server
|
||||||
|
delete newClientConfig.autoWithdrawMaxFeePercent
|
||||||
|
delete newClientConfig.autoWithdrawMaxFeeTotal
|
||||||
} catch {
|
} catch {
|
||||||
valid = false
|
valid = false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user