FIX: Do not refresh all settings on save for all settings, limit to only a few

- Followup to 0e303c7f5d

- Automatically reloads site settings after saving only for the logo, logo_small and large_icon settings.
This commit is contained in:
Penar Musaraj 2019-06-20 10:57:31 -04:00 committed by Neil Lalonde
parent e1822034dc
commit 8b963bce37

View File

@ -17,6 +17,8 @@ const CUSTOM_TYPES = [
"group_list" "group_list"
]; ];
const AUTO_REFRESH_ON_SAVE = ["logo", "logo_small", "large_icon"];
export default Ember.Mixin.create({ export default Ember.Mixin.create({
classNameBindings: [":row", ":setting", "overridden", "typeClass"], classNameBindings: [":row", ":setting", "overridden", "typeClass"],
content: Ember.computed.alias("setting"), content: Ember.computed.alias("setting"),
@ -113,7 +115,9 @@ export default Ember.Mixin.create({
.then(() => { .then(() => {
this.set("validationMessage", null); this.set("validationMessage", null);
this.commitBuffer(); this.commitBuffer();
if (AUTO_REFRESH_ON_SAVE.includes(this.get("setting.setting"))) {
this.afterSave(); this.afterSave();
}
}) })
.catch(e => { .catch(e => {
if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) { if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {