0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Changed to getActive from bridge in toJSON

refs: bf0823c9a2

- continuing the work of splitting up the theme service into logical components
- this file is not part of the theme engine so it should use the bridge not the engine
- am about to move the theme service to core/server so this will make even more sense then
This commit is contained in:
Hannah Wolfe 2021-04-27 13:49:15 +01:00
parent af09d55c7a
commit 53669b6e71

View file

@ -1,6 +1,6 @@
const _ = require('lodash'); const _ = require('lodash');
const themeList = require('./list'); const themeList = require('./list');
const active = require('../theme-engine/active'); const bridge = require('../../../bridge');
const packageJSON = require('../../../server/lib/fs/package-json'); const packageJSON = require('../../../server/lib/fs/package-json');
const settingsCache = require('../../../server/services/settings/cache'); const settingsCache = require('../../../server/services/settings/cache');
@ -40,8 +40,8 @@ module.exports = function toJSON(name, checkedTheme) {
} }
// CASE: if you want a JSON response for a single theme, which is not active. // CASE: if you want a JSON response for a single theme, which is not active.
if (_.find(themeResult, {active: true}) && active.get()) { if (_.find(themeResult, {active: true}) && bridge.getActiveTheme()) {
_.find(themeResult, {active: true}).templates = active.get().customTemplates; _.find(themeResult, {active: true}).templates = bridge.getActiveTheme().customTemplates;
} }
return {themes: themeResult}; return {themes: themeResult};