refactor: use configs version from configs object

This commit is contained in:
siiky 2025-06-12 15:47:52 +01:00
parent 430ca16cc5
commit afae156ef9

View file

@ -5,7 +5,6 @@ const nmd = require('nano-markdown')
const plugins = require('../plugins') const plugins = require('../plugins')
const configManager = require('../new-config-manager') const configManager = require('../new-config-manager')
const settingsLoader = require('../new-settings-loader')
const { const {
batchGetCustomInfoRequest, batchGetCustomInfoRequest,
getCustomInfoRequests, getCustomInfoRequests,
@ -411,17 +410,13 @@ const terms = (parent, { currentConfigVersion, currentHash }, { settings }) => {
const isHashNew = hash !== currentHash const isHashNew = hash !== currentHash
const text = isHashNew ? latestTerms.text : null const text = isHashNew ? latestTerms.text : null
return settingsLoader const isVersionNew =
.fetchCurrentConfigVersion()
.catch(() => null)
.then(
configVersion =>
isHashNew || isHashNew ||
_.isNil(currentConfigVersion) || _.isNil(currentConfigVersion) ||
currentConfigVersion < configVersion, currentConfigVersion < settings.version
) const details = isVersionNew ? _.omit(['text'], latestTerms) : null
.then(isVersionNew => (isVersionNew ? _.omit(['text'], latestTerms) : null))
.then(details => ({ hash, details, text })) return { hash, details, text }
} }
module.exports = { module.exports = {