refactor: move fetchCurrentConfigVersion() to settings loader
This commit is contained in:
parent
d3d4042d97
commit
bb440eedd6
4 changed files with 20 additions and 24 deletions
|
|
@ -3,6 +3,7 @@ const nmd = require('nano-markdown')
|
|||
|
||||
const plugins = require('../plugins')
|
||||
const configManager = require('../new-config-manager')
|
||||
const settingsLoader = require('../new-settings-loader')
|
||||
const { batchGetCustomInfoRequest, getCustomInfoRequests } = require('../new-admin/services/customInfoRequests')
|
||||
const state = require('../middlewares/state')
|
||||
const { getMachine } = require('../machine-loader')
|
||||
|
|
@ -323,8 +324,7 @@ const terms = (parent, { currentConfigVersion, currentHash }, { deviceId, settin
|
|||
const isHashNew = hash !== currentHash
|
||||
const text = isHashNew ? latestTerms.text : null
|
||||
|
||||
return plugins(settings, deviceId)
|
||||
.fetchCurrentConfigVersion()
|
||||
return settingsLoader.fetchCurrentConfigVersion()
|
||||
.catch(() => null)
|
||||
.then(configVersion => isHashNew || _.isNil(currentConfigVersion) || currentConfigVersion < configVersion)
|
||||
.then(isVersionNew => isVersionNew ? _.omit(['text'], latestTerms) : null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue