FIX: Notifying users via flag wasn't refreshing the UX

This commit is contained in:
Robin Ward 2016-02-16 14:35:12 -05:00
parent ba203b3a94
commit 5bc1c5130e
1 changed files with 6 additions and 6 deletions

View File

@ -89,7 +89,6 @@ export default Ember.Controller.extend(ModalFunctionality, {
},
createFlag(opts) {
const self = this;
let postAction; // an instance of ActionSummary
if (!this.get('flagTopic')) {
@ -103,13 +102,14 @@ export default Ember.Controller.extend(ModalFunctionality, {
this.send('hideModal');
postAction.act(this.get('model'), params).then(function() {
self.send('closeModal');
postAction.act(this.get('model'), params).then(() => {
this.send('closeModal');
if (params.message) {
self.set('message', '');
this.set('message', '');
}
}, function(errors) {
self.send('closeModal');
this.appEvents.trigger('post-stream:refresh', { id: this.get('model.id') });
}).catch(errors => {
this.send('closeModal');
if (errors && errors.responseText) {
bootbox.alert($.parseJSON(errors.responseText).errors);
} else {