From bee8425055e68601c4baa79987eb9038de04d559 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 3 Jan 2017 11:49:20 -0500 Subject: [PATCH] FIX: Don't reply as new topic when quoting a closed topic --- app/assets/javascripts/discourse/controllers/topic.js.es6 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index 89d11a01fc7..6bedd2b5f33 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -170,8 +170,11 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { selectText(postId, buffer) { return this.get('model.postStream').loadPost(postId).then(post => { + const composer = this.get('composer'); + const viewOpen = composer.get('model.viewOpen'); + // If we can't create a post, delegate to reply as new topic - if (!this.get('model.details.can_create_post')) { + if ((!viewOpen) && (!this.get('model.details.can_create_post'))) { this.send('replyAsNewTopic', post); return; } @@ -188,7 +191,6 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { } // If the composer is associated with a different post, we don't change it. - const composer = this.get('composer'); const composerPost = composer.get('model.post'); if (composerPost && (composerPost.get('id') !== this.get('post.id'))) { composerOpts.post = composerPost;