Merge pull request #1320 from chaotixkilla/fix-remove-coin-specific-unit-fields
Remove coin-specific cryptounits from config
This commit is contained in:
commit
1d0f3cd27c
4 changed files with 37 additions and 13 deletions
|
|
@ -151,9 +151,7 @@ const getCryptosFromWalletNamespace = config => {
|
|||
|
||||
const getCashInSettings = config => fromNamespace(namespaces.CASH_IN)(config)
|
||||
|
||||
const getCryptoUnits = (crypto, config) => {
|
||||
return getWalletSettings(crypto, config).cryptoUnits
|
||||
}
|
||||
const getCryptoUnits = (crypto, config) => getWalletSettings(crypto, config).cryptoUnits
|
||||
|
||||
const setTermsConditions = toNamespace(namespaces.TERMS_CONDITIONS)
|
||||
|
||||
|
|
|
|||
|
|
@ -112,6 +112,17 @@ function saveConfig (config) {
|
|||
})
|
||||
}
|
||||
|
||||
function removeFromConfig (fields) {
|
||||
return Promise.all([loadLatestConfigOrNone(), getOperatorId('middleware')])
|
||||
.then(([currentConfig, operatorId]) => {
|
||||
const newConfig = _.omit(fields, currentConfig)
|
||||
return db.tx(t => {
|
||||
return t.none(configSql, ['config', { config: newConfig }, true, NEW_SETTINGS_LOADER_SCHEMA_VERSION])
|
||||
.then(() => t.none('NOTIFY $1:name, $2', ['reload', JSON.stringify({ schema: asyncLocalStorage.getStore().get('schema'), operatorId })]))
|
||||
}).catch(console.error)
|
||||
})
|
||||
}
|
||||
|
||||
function migrationSaveConfig (config) {
|
||||
return loadLatestConfigOrNone()
|
||||
.then(currentConfig => {
|
||||
|
|
@ -221,5 +232,6 @@ module.exports = {
|
|||
loadLatestConfig,
|
||||
loadLatestConfigOrNone,
|
||||
load,
|
||||
migrate
|
||||
migrate,
|
||||
removeFromConfig
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue