Files
discourse/app/assets/javascripts/discourse/services/theme-settings.js.es6
David Taylor 3c6176b844 FIX: Allow accessing nested objects within theme settings
This is required to access keys within the new theme_uploads object
2019-08-30 12:27:02 +01:00

24 lines
466 B
JavaScript

export default Ember.Service.extend({
settings: null,
init() {
this._super(...arguments);
this._settings = {};
},
registerSettings(themeId, settingsObject) {
this._settings[themeId] = settingsObject;
},
getSetting(themeId, settingsKey) {
if (this._settings[themeId]) {
return Ember.get(this._settings[themeId], settingsKey);
}
return null;
},
getObjectForTheme(themeId) {
return this._settings[themeId];
}
});