From 4ad3a258d1cbc1638a11b70419573fd7b144d849 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Thu, 8 Mar 2018 20:09:31 +0530 Subject: [PATCH] FIX: tag filter was not selected on page load --- .../discourse/controllers/user-private-messages.js.es6 | 1 + .../discourse/routes/user-private-messages-tag.js.es6 | 1 + app/assets/javascripts/discourse/templates/user/messages.hbs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 b/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 index 34b04a40574..9f50056d0bb 100644 --- a/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 @@ -14,6 +14,7 @@ export default Ember.Controller.extend({ bulkSelectEnabled: Em.computed.alias('userTopicsList.bulkSelectEnabled'), pmTags: Em.computed.alias('userTopicsList.model.topic_list.pm_tags'), pmTaggingEnabled: Ember.computed.alias('site.can_tag_pms'), + tagId: null, showNewPM: function(){ return this.get('user.viewingSelf') && diff --git a/app/assets/javascripts/discourse/routes/user-private-messages-tag.js.es6 b/app/assets/javascripts/discourse/routes/user-private-messages-tag.js.es6 index 45451953320..8d6a16975d7 100644 --- a/app/assets/javascripts/discourse/routes/user-private-messages-tag.js.es6 +++ b/app/assets/javascripts/discourse/routes/user-private-messages-tag.js.es6 @@ -2,6 +2,7 @@ import createPMRoute from "discourse/routes/build-private-messages-route"; export default createPMRoute('tags', 'private-messages-tags').extend({ model(params) { + this.controllerFor('user-private-messages').set('tagId', params.id); const username = this.modelFor("user").get("username_lower"); return this.store.findFiltered("topicList", { filter: `topics/private-messages-tag/${username}/${params.id}` diff --git a/app/assets/javascripts/discourse/templates/user/messages.hbs b/app/assets/javascripts/discourse/templates/user/messages.hbs index e9fceab0fdf..27808fd6983 100644 --- a/app/assets/javascripts/discourse/templates/user/messages.hbs +++ b/app/assets/javascripts/discourse/templates/user/messages.hbs @@ -76,7 +76,7 @@ {{/if}} {{#if pmTaggingEnabled}} - {{pm-tag-drop pmTags=pmTags}} + {{pm-tag-drop pmTags=pmTags tagId=tagId}} {{/if}}