FIX: Closing and opening topic should increment posts count.

This commit is contained in:
Guo Xiang Tan 2015-08-19 18:04:42 +08:00
parent f1bce927b3
commit 23c4b51805
1 changed files with 6 additions and 2 deletions

View File

@ -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',