From 23c4b51805081ac15c71dbc70260351a536393c4 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 19 Aug 2015 18:04:42 +0800 Subject: [PATCH] FIX: Closing and opening topic should increment posts count. --- app/assets/javascripts/discourse/models/topic.js.es6 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/models/topic.js.es6 b/app/assets/javascripts/discourse/models/topic.js.es6 index 0fab68fa108..07378493461 100644 --- a/app/assets/javascripts/discourse/models/topic.js.es6 +++ b/app/assets/javascripts/discourse/models/topic.js.es6 @@ -157,8 +157,12 @@ const Topic = RestModel.extend({ }, saveStatus(property, value, until) { - if (property === 'closed' && value === true) { - this.set('details.auto_close_at', null); + if (property === 'closed') { + this.incrementProperty('posts_count'); + + if (value === true) { + this.set('details.auto_close_at', null); + } } return Discourse.ajax(this.get('url') + "/status", { type: 'PUT',