From 8b963bce378bb7f5c02becaf6bda5ad3f7a9a990 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Thu, 20 Jun 2019 10:57:31 -0400 Subject: [PATCH] FIX: Do not refresh all settings on save for all settings, limit to only a few - Followup to 0e303c7f5d2767c37b9078226b5ce1d20fa3678e - Automatically reloads site settings after saving only for the logo, logo_small and large_icon settings. --- .../javascripts/admin/mixins/setting-component.js.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/mixins/setting-component.js.es6 b/app/assets/javascripts/admin/mixins/setting-component.js.es6 index 9f8166fbecf..dbed60a7997 100644 --- a/app/assets/javascripts/admin/mixins/setting-component.js.es6 +++ b/app/assets/javascripts/admin/mixins/setting-component.js.es6 @@ -17,6 +17,8 @@ const CUSTOM_TYPES = [ "group_list" ]; +const AUTO_REFRESH_ON_SAVE = ["logo", "logo_small", "large_icon"]; + export default Ember.Mixin.create({ classNameBindings: [":row", ":setting", "overridden", "typeClass"], content: Ember.computed.alias("setting"), @@ -113,7 +115,9 @@ export default Ember.Mixin.create({ .then(() => { this.set("validationMessage", null); this.commitBuffer(); - this.afterSave(); + if (AUTO_REFRESH_ON_SAVE.includes(this.get("setting.setting"))) { + this.afterSave(); + } }) .catch(e => { if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {