diff --git a/ember/app/adapters/application.js b/ember/app/adapters/application.js index 595489cbd..8487c2565 100644 --- a/ember/app/adapters/application.js +++ b/ember/app/adapters/application.js @@ -31,7 +31,7 @@ export default JsonApiAdapter.extend({ } else { message = errors.message; } - var alert = AlertMessage.create({ + var alert = AlertMessage.extend({ type: 'warning', message: message }); diff --git a/ember/app/controllers/alerts.js b/ember/app/controllers/alerts.js index 1ce9f27f4..562f165ae 100644 --- a/ember/app/controllers/alerts.js +++ b/ember/app/controllers/alerts.js @@ -8,7 +8,7 @@ export default Ember.Controller.extend({ this.get('alerts').pushObject(message); }, dismissAlert: function(message) { - this.get('alerts').removeObject(message); + this.get('alerts').removeObject(message.constructor); }, clearAlerts: function() { this.get('alerts').clear(); diff --git a/ember/app/routes/application.js b/ember/app/routes/application.js index bf0e1ae78..47a3aa973 100644 --- a/ember/app/routes/application.js +++ b/ember/app/routes/application.js @@ -6,7 +6,7 @@ import AlertMessage from 'flarum/components/ui/alert-message'; export default Ember.Route.extend(ApplicationRouteMixin, { activate: function() { if (!Ember.isEmpty(FLARUM_ALERT)) { - this.controllerFor('alerts').send('alert', AlertMessage.create(FLARUM_ALERT)); + this.controllerFor('alerts').send('alert', AlertMessage.extend(FLARUM_ALERT)); FLARUM_ALERT = null; }