Ghost/core/server/services/themes/activation-bridge.js
Hannah Wolfe c3774a3fab
Moved bridge.activateTheme calls into one place
- This is a slightly weird thing, but the intention is to highlight that there are 3 different code paths that can activate a theme
- Ideally we want to unify all the codepaths more, but for now this at least helps us see what is happening where
2021-07-07 15:02:02 +01:00

22 lines
865 B
JavaScript

const debug = require('@tryghost/debug')('themes');
const bridge = require('../../../bridge');
/**
* These helper methods mean that the bridge is only required in one place
* And also adds a little debug statement, which is very handy when debugging theme logic
*/
module.exports = {
activateFromBoot: (themeName, theme, checkedTheme) => {
debug('Activating theme (method A on boot)', themeName);
bridge.activateTheme(theme, checkedTheme);
},
activateFromAPI: (themeName, theme, checkedTheme) => {
debug('Activating theme (method B on API "activate")', themeName);
bridge.activateTheme(theme, checkedTheme);
},
activateFromAPIOverride: (themeName, theme, checkedTheme) => {
debug('Activating theme (method C on API "override")', themeName);
bridge.activateTheme(theme, checkedTheme);
}
};