mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: Do not show an empty modal when an IP address is allowed or blocked. (#6265)
This commit is contained in:

committed by
Régis Hanol

parent
860c1c3dcd
commit
dc5fddbfe6
@ -59,18 +59,14 @@ export default Ember.Component.extend({
|
||||
screenedIpAddress
|
||||
.save()
|
||||
.then(result => {
|
||||
if (result.success) {
|
||||
this.setProperties({ ip_address: "", formSubmitted: false });
|
||||
this.sendAction(
|
||||
"action",
|
||||
ScreenedIpAddress.create(result.screened_ip_address)
|
||||
);
|
||||
Ember.run.schedule("afterRender", () =>
|
||||
this.$(".ip-address-input").focus()
|
||||
);
|
||||
} else {
|
||||
bootbox.alert(result.errors);
|
||||
}
|
||||
this.setProperties({ ip_address: "", formSubmitted: false });
|
||||
this.sendAction(
|
||||
"action",
|
||||
ScreenedIpAddress.create(result.screened_ip_address)
|
||||
);
|
||||
Ember.run.schedule("afterRender", () =>
|
||||
this.$(".ip-address-input").focus()
|
||||
);
|
||||
})
|
||||
.catch(e => {
|
||||
this.set("formSubmitted", false);
|
||||
|
Reference in New Issue
Block a user