mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 21:24:41 +08:00
FIX: Show correct avatar in post stream bar (#11481)
Also fixes the displayed count of posts when filtered by user.
This commit is contained in:
@ -41,6 +41,7 @@ export default MountWidget.extend({
|
|||||||
return this.getProperties(
|
return this.getProperties(
|
||||||
"posts",
|
"posts",
|
||||||
"canCreatePost",
|
"canCreatePost",
|
||||||
|
"filteredPostsCount",
|
||||||
"multiSelect",
|
"multiSelect",
|
||||||
"gaps",
|
"gaps",
|
||||||
"selectedQuery",
|
"selectedQuery",
|
||||||
|
@ -200,6 +200,7 @@
|
|||||||
canCreatePost=model.details.can_create_post
|
canCreatePost=model.details.can_create_post
|
||||||
multiSelect=multiSelect
|
multiSelect=multiSelect
|
||||||
selectedPostsCount=selectedPostsCount
|
selectedPostsCount=selectedPostsCount
|
||||||
|
filteredPostsCount=model.postStream.filteredPostsCount
|
||||||
selectedQuery=selectedQuery
|
selectedQuery=selectedQuery
|
||||||
gaps=model.postStream.gaps
|
gaps=model.postStream.gaps
|
||||||
showReadIndicator=model.show_read_indicator
|
showReadIndicator=model.show_read_indicator
|
||||||
|
@ -119,22 +119,24 @@ createWidget("posts-filtered-notice", {
|
|||||||
this.attach("filter-show-all", attrs),
|
this.attach("filter-show-all", attrs),
|
||||||
];
|
];
|
||||||
} else if (filters.username_filters) {
|
} else if (filters.username_filters) {
|
||||||
|
const firstUserPost = attrs.posts[1],
|
||||||
|
userPostsCount = parseInt(attrs.filteredPostsCount, 10) - 1;
|
||||||
return [
|
return [
|
||||||
h(
|
h(
|
||||||
"span.filtered-replies-viewing",
|
"span.filtered-replies-viewing",
|
||||||
I18n.t("post.filtered_replies.viewing_posts_by", {
|
I18n.t("post.filtered_replies.viewing_posts_by", {
|
||||||
post_count: attrs.posts.length,
|
post_count: userPostsCount,
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
h(
|
h(
|
||||||
"span.filtered-avatar",
|
"span.filtered-avatar",
|
||||||
avatarFor.call(this, "small", {
|
avatarFor.call(this, "small", {
|
||||||
template: attrs.posts[0].avatar_template,
|
template: firstUserPost.avatar_template,
|
||||||
username: attrs.posts[0].username,
|
username: firstUserPost.username,
|
||||||
url: attrs.posts[0].usernameUrl,
|
url: firstUserPost.usernameUrl,
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
this.attach("poster-name", attrs.posts[0]),
|
this.attach("poster-name", firstUserPost),
|
||||||
this.attach("filter-show-all", attrs),
|
this.attach("filter-show-all", attrs),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -282,6 +284,7 @@ export default createWidget("post-stream", {
|
|||||||
this.attach("posts-filtered-notice", {
|
this.attach("posts-filtered-notice", {
|
||||||
posts: postArray,
|
posts: postArray,
|
||||||
streamFilters: attrs.streamFilters,
|
streamFilters: attrs.streamFilters,
|
||||||
|
filteredPostsCount: attrs.filteredPostsCount,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user