From eca291c9fc8a7da1da036d3d81af836eed5426eb Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 27 Dec 2013 15:38:57 -0500 Subject: [PATCH] FIX: After closing a topic that's set to auto-close, remove the message that it will auto-close. Server was already doing the right thing. --- app/assets/javascripts/discourse/models/topic.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/discourse/models/topic.js b/app/assets/javascripts/discourse/models/topic.js index 339930c0413..c34bfaee2a0 100644 --- a/app/assets/javascripts/discourse/models/topic.js +++ b/app/assets/javascripts/discourse/models/topic.js @@ -146,6 +146,9 @@ Discourse.Topic = Discourse.Model.extend({ toggleStatus: function(property) { this.toggleProperty(property); + if (property === 'closed' && this.get('closed')) { + this.set('details.auto_close_at', null); + } return Discourse.ajax(this.get('url') + "/status", { type: 'PUT', data: {status: property, enabled: this.get(property) ? 'true' : 'false' }