From d2502bd1272762272682e14ed085e65a65f1b6dc Mon Sep 17 00:00:00 2001 From: cpradio Date: Tue, 20 Oct 2015 09:40:43 -0400 Subject: [PATCH] FIX: Fix the shortcut shift+p for pinning/unpinning a topic --- app/assets/javascripts/discourse/controllers/topic.js.es6 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index 8a6c7b228..8d54f9918 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -374,10 +374,11 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { togglePinnedForUser() { if (this.get('model.pinned_at')) { - if (this.get('pinned')) { - this.get('content').clearPin(); + const topic = this.get('content'); + if (topic.get('pinned')) { + topic.clearPin(); } else { - this.get('content').rePin(); + topic.rePin(); } } },