mirror of
https://github.com/flarum/core.git
synced 2025-07-25 18:51:40 +02:00
Update discussion details upon reply
This commit is contained in:
@@ -60,10 +60,20 @@ export default Ember.ObjectController.extend(Ember.Evented, {
|
|||||||
return post.save().then(function(post) {
|
return post.save().then(function(post) {
|
||||||
composer.send('hide');
|
composer.send('hide');
|
||||||
|
|
||||||
|
discussion.setProperties({
|
||||||
|
posts: discussion.get('posts')+','+post.get('id'),
|
||||||
|
lastTime: post.get('time'),
|
||||||
|
lastUser: post.get('user'),
|
||||||
|
lastPost: post,
|
||||||
|
lastPostNumber: post.get('number'),
|
||||||
|
commentsCount: discussion.get('commentsCount') + 1,
|
||||||
|
readTime: post.get('time'),
|
||||||
|
readNumber: post.get('number')
|
||||||
|
});
|
||||||
|
|
||||||
// If we're currently viewing the discussion which this reply was
|
// If we're currently viewing the discussion which this reply was
|
||||||
// made in, then we can add the post to the end of the post
|
// made in, then we can add the post to the end of the post
|
||||||
// stream.
|
// stream.
|
||||||
discussion.set('posts', discussion.get('posts')+','+post.get('id'));
|
|
||||||
if (discussion == controller.get('model')) {
|
if (discussion == controller.get('model')) {
|
||||||
stream.set('ids', discussion.get('postIds'));
|
stream.set('ids', discussion.get('postIds'));
|
||||||
stream.addPostToEnd(post);
|
stream.addPostToEnd(post);
|
||||||
|
Reference in New Issue
Block a user