From 0930db221fad8e74c7a610612a22ea57ed0a41a6 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 19 Apr 2017 15:31:21 -0400 Subject: [PATCH] FIX: destroying color scheme could remove wrong item from UI --- .../admin/controllers/admin-customize-colors-show.js.es6 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js.es6 index ad276be33a9..e333d2a58de 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js.es6 @@ -60,10 +60,11 @@ export default Ember.Controller.extend({ destroy: function() { + const model = this.get('model'); return bootbox.confirm(I18n.t("admin.customize.colors.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), result => { if (result) { - this.get('model').destroy().then(()=>{ - this.get('allColors').removeObject(this.get('model')); + model.destroy().then(()=>{ + this.get('allColors').removeObject(model); this.replaceRoute('adminCustomize.colors'); }); }