FIX: destroying color scheme could remove wrong item from UI

This commit is contained in:
Sam 2017-04-19 15:31:21 -04:00
parent c5ee448713
commit 0930db221f

View File

@ -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');
});
}