Ghost/core/server/services/themes/activation-bridge.js
Kevin Ansfield cabf78e938 Cleaned up customThemeSettings labs flag
closes https://github.com/TryGhost/Team/issues/1164

- `customThemeSettings` feature is GA so any conditionals can be cleaned up
- removed conditional loading of custom theme settings and associated API routes
- removed event trigger for reloading custom theme settings when the feature flag is toggled
- removed flag from labs GA list
2022-01-03 17:45:25 +00:00

29 lines
1.5 KiB
JavaScript

const debug = require('@tryghost/debug')('themes');
const bridge = require('../../../bridge');
const customThemeSettings = require('../custom-theme-settings');
/**
* 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: async (themeName, theme, checkedTheme) => {
debug('Activating theme (method A on boot)', themeName);
// TODO: probably a better place for this to happen - after successful activation / when reloading site?
await customThemeSettings.api.activateTheme(themeName, checkedTheme);
await bridge.activateTheme(theme, checkedTheme);
},
activateFromAPI: async (themeName, theme, checkedTheme) => {
debug('Activating theme (method B on API "activate")', themeName);
// TODO: probably a better place for this to happen - after successful activation / when reloading site?
await customThemeSettings.api.activateTheme(themeName, checkedTheme);
await bridge.activateTheme(theme, checkedTheme);
},
activateFromAPIOverride: async (themeName, theme, checkedTheme) => {
debug('Activating theme (method C on API "override")', themeName);
// TODO: probably a better place for this to happen - after successful activation / when reloading site?
await customThemeSettings.api.activateTheme(themeName, checkedTheme);
await bridge.activateTheme(theme, checkedTheme);
}
};