mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
c3774a3fab
- 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
22 lines
865 B
JavaScript
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);
|
|
}
|
|
};
|