mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Have a go at some error handling
Still not happy with how this is all fitting together. But good enough for now
This commit is contained in:
@@ -76,15 +76,19 @@ export default Ember.Controller.extend(Ember.Evented, UseComposerMixin, {
|
||||
reply: function() {
|
||||
var discussion = this.get('model');
|
||||
var controller = this;
|
||||
this.showComposer(function() {
|
||||
return ComposerReply.create({
|
||||
user: controller.get('session.user'),
|
||||
discussion: discussion,
|
||||
submit: function(data) {
|
||||
controller.saveReply(discussion, data);
|
||||
}
|
||||
if (this.get('session.isAuthenticated')) {
|
||||
this.showComposer(function() {
|
||||
return ComposerReply.create({
|
||||
user: controller.get('session.user'),
|
||||
discussion: discussion,
|
||||
submit: function(data) {
|
||||
controller.saveReply(discussion, data);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.send('signup');
|
||||
}
|
||||
},
|
||||
|
||||
// This action is called when the start position of the discussion
|
||||
|
Reference in New Issue
Block a user