mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: destroying color scheme could remove wrong item from UI
This commit is contained in:
parent
c5ee448713
commit
0930db221f
1 changed files with 3 additions and 2 deletions
|
@ -60,10 +60,11 @@ export default Ember.Controller.extend({
|
||||||
|
|
||||||
destroy: function() {
|
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 => {
|
return bootbox.confirm(I18n.t("admin.customize.colors.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.get('model').destroy().then(()=>{
|
model.destroy().then(()=>{
|
||||||
this.get('allColors').removeObject(this.get('model'));
|
this.get('allColors').removeObject(model);
|
||||||
this.replaceRoute('adminCustomize.colors');
|
this.replaceRoute('adminCustomize.colors');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue