refactor: use loadLatestConfig() in place of loadLatest() where applicable

This commit is contained in:
siiky 2024-09-17 15:38:35 +01:00
parent 5342e9a8be
commit cac88fda45
15 changed files with 52 additions and 56 deletions

View file

@ -1,11 +1,11 @@
const { removeFromConfig, loadLatest } = require('../lib/new-settings-loader')
const { removeFromConfig, loadLatestConfig } = require('../lib/new-settings-loader')
const { getCryptosFromWalletNamespace } = require('../lib/new-config-manager.js')
const _ = require('lodash/fp')
exports.up = function (next) {
loadLatest()
.then(settings => {
const configuredCryptos = getCryptosFromWalletNamespace(settings.config)
loadLatestConfig()
.then(config => {
const configuredCryptos = getCryptosFromWalletNamespace(config)
if (!configuredCryptos.length) return Promise.resolve()
return removeFromConfig(_.map(it => `wallets_${it}_cryptoUnits`, configuredCryptos))