FIX: tag filter was not selected on page load

This commit is contained in:
Arpit Jalan 2018-03-08 20:09:31 +05:30
parent 55fd18e195
commit 4ad3a258d1
3 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@ export default Ember.Controller.extend({
bulkSelectEnabled: Em.computed.alias('userTopicsList.bulkSelectEnabled'), bulkSelectEnabled: Em.computed.alias('userTopicsList.bulkSelectEnabled'),
pmTags: Em.computed.alias('userTopicsList.model.topic_list.pm_tags'), pmTags: Em.computed.alias('userTopicsList.model.topic_list.pm_tags'),
pmTaggingEnabled: Ember.computed.alias('site.can_tag_pms'), pmTaggingEnabled: Ember.computed.alias('site.can_tag_pms'),
tagId: null,
showNewPM: function(){ showNewPM: function(){
return this.get('user.viewingSelf') && return this.get('user.viewingSelf') &&

View File

@ -2,6 +2,7 @@ import createPMRoute from "discourse/routes/build-private-messages-route";
export default createPMRoute('tags', 'private-messages-tags').extend({ export default createPMRoute('tags', 'private-messages-tags').extend({
model(params) { model(params) {
this.controllerFor('user-private-messages').set('tagId', params.id);
const username = this.modelFor("user").get("username_lower"); const username = this.modelFor("user").get("username_lower");
return this.store.findFiltered("topicList", { return this.store.findFiltered("topicList", {
filter: `topics/private-messages-tag/${username}/${params.id}` filter: `topics/private-messages-tag/${username}/${params.id}`

View File

@ -76,7 +76,7 @@
{{/if}} {{/if}}
{{#if pmTaggingEnabled}} {{#if pmTaggingEnabled}}
{{pm-tag-drop pmTags=pmTags}} {{pm-tag-drop pmTags=pmTags tagId=tagId}}
{{/if}} {{/if}}
</div> </div>