mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 20:36:39 +08:00
parent
bd969332e0
commit
3cdcd093ee
|
@ -5,14 +5,6 @@ import showModal from "discourse/lib/show-modal";
|
|||
import AboutRoute from "discourse/routes/about";
|
||||
|
||||
export default Ember.Component.extend(BufferedContent, SettingComponent, {
|
||||
update(key, value, updateExistingUsers = false) {
|
||||
if (updateExistingUsers) {
|
||||
return SiteSetting.update(key, value, { updateExistingUsers: true });
|
||||
} else {
|
||||
return SiteSetting.update(key, value);
|
||||
}
|
||||
},
|
||||
|
||||
_save(callback) {
|
||||
const defaultCategoriesSettings = [
|
||||
"default_categories_watching",
|
||||
|
@ -36,19 +28,16 @@ export default Ember.Component.extend(BufferedContent, SettingComponent, {
|
|||
admin: true
|
||||
});
|
||||
|
||||
controller.setProperties({
|
||||
onClose: () => {
|
||||
const updateExistingUsers = controller.get("updateExistingUsers");
|
||||
if (updateExistingUsers === true) {
|
||||
callback(this.update(key, value, true));
|
||||
} else if (updateExistingUsers === false) {
|
||||
callback(this.update(key, value));
|
||||
}
|
||||
}
|
||||
controller.set("onClose", () => {
|
||||
callback(
|
||||
SiteSetting.update(key, value, {
|
||||
updateExistingUsers: controller.updateExistingUsers
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
callback(this.update(key, value));
|
||||
callback(SiteSetting.update(key, value));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -116,7 +116,7 @@ export default Ember.Mixin.create({
|
|||
.then(() => {
|
||||
this.set("validationMessage", null);
|
||||
this.commitBuffer();
|
||||
if (AUTO_REFRESH_ON_SAVE.includes(this.get("setting.setting"))) {
|
||||
if (AUTO_REFRESH_ON_SAVE.includes(this.setting.setting)) {
|
||||
this.afterSave();
|
||||
}
|
||||
})
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
{{/d-modal-body}}
|
||||
|
||||
<div class="modal-footer">
|
||||
{{d-button action=(action "updateExistingUsers") class='btn btn-primary' label='admin.site_settings.default_categories.modal_yes'}}
|
||||
{{d-button action=(action "cancel") class='btn' label='admin.site_settings.default_categories.modal_no'}}
|
||||
{{d-button action=(action "updateExistingUsers") class='btn-primary' label='admin.site_settings.default_categories.modal_yes'}}
|
||||
{{d-button action=(action "cancel") label='admin.site_settings.default_categories.modal_no'}}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user