Fix TypeError in isConfigured if no enabled wallet found
This commit is contained in:
parent
5b561e22a9
commit
e091377d94
|
@ -122,12 +122,12 @@ function useConfig (wallet) {
|
||||||
return [config, saveConfig, clearConfig]
|
return [config, saveConfig, clearConfig]
|
||||||
}
|
}
|
||||||
|
|
||||||
function isConfigured (wallet) {
|
function isConfigured ({ fields, config }) {
|
||||||
if (!wallet.config) return false
|
if (!config || !fields) return false
|
||||||
|
|
||||||
// a wallet is configured if all of it's required fields are set
|
// a wallet is configured if all of it's required fields are set
|
||||||
const val = wallet.fields.every(field => {
|
const val = fields.every(field => {
|
||||||
return field.optional ? true : !!wallet.config?.[field.name]
|
return field.optional ? true : !!config?.[field.name]
|
||||||
})
|
})
|
||||||
|
|
||||||
return val
|
return val
|
||||||
|
|
Loading…
Reference in New Issue