mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 00:35:50 +00:00
FIX: Notifying users via flag wasn't refreshing the UX
This commit is contained in:
parent
ba203b3a94
commit
5bc1c5130e
@ -89,7 +89,6 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
createFlag(opts) {
|
createFlag(opts) {
|
||||||
const self = this;
|
|
||||||
let postAction; // an instance of ActionSummary
|
let postAction; // an instance of ActionSummary
|
||||||
|
|
||||||
if (!this.get('flagTopic')) {
|
if (!this.get('flagTopic')) {
|
||||||
@ -103,13 +102,14 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
|
|
||||||
this.send('hideModal');
|
this.send('hideModal');
|
||||||
|
|
||||||
postAction.act(this.get('model'), params).then(function() {
|
postAction.act(this.get('model'), params).then(() => {
|
||||||
self.send('closeModal');
|
this.send('closeModal');
|
||||||
if (params.message) {
|
if (params.message) {
|
||||||
self.set('message', '');
|
this.set('message', '');
|
||||||
}
|
}
|
||||||
}, function(errors) {
|
this.appEvents.trigger('post-stream:refresh', { id: this.get('model.id') });
|
||||||
self.send('closeModal');
|
}).catch(errors => {
|
||||||
|
this.send('closeModal');
|
||||||
if (errors && errors.responseText) {
|
if (errors && errors.responseText) {
|
||||||
bootbox.alert($.parseJSON(errors.responseText).errors);
|
bootbox.alert($.parseJSON(errors.responseText).errors);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user