mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 15:04:00 +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:
parent
b45a30c40f
commit
0e210df79a
|
@ -41,6 +41,7 @@ export default MountWidget.extend({
|
|||
return this.getProperties(
|
||||
"posts",
|
||||
"canCreatePost",
|
||||
"filteredPostsCount",
|
||||
"multiSelect",
|
||||
"gaps",
|
||||
"selectedQuery",
|
||||
|
|
|
@ -200,6 +200,7 @@
|
|||
canCreatePost=model.details.can_create_post
|
||||
multiSelect=multiSelect
|
||||
selectedPostsCount=selectedPostsCount
|
||||
filteredPostsCount=model.postStream.filteredPostsCount
|
||||
selectedQuery=selectedQuery
|
||||
gaps=model.postStream.gaps
|
||||
showReadIndicator=model.show_read_indicator
|
||||
|
|
|
@ -119,22 +119,24 @@ createWidget("posts-filtered-notice", {
|
|||
this.attach("filter-show-all", attrs),
|
||||
];
|
||||
} else if (filters.username_filters) {
|
||||
const firstUserPost = attrs.posts[1],
|
||||
userPostsCount = parseInt(attrs.filteredPostsCount, 10) - 1;
|
||||
return [
|
||||
h(
|
||||
"span.filtered-replies-viewing",
|
||||
I18n.t("post.filtered_replies.viewing_posts_by", {
|
||||
post_count: attrs.posts.length,
|
||||
post_count: userPostsCount,
|
||||
})
|
||||
),
|
||||
h(
|
||||
"span.filtered-avatar",
|
||||
avatarFor.call(this, "small", {
|
||||
template: attrs.posts[0].avatar_template,
|
||||
username: attrs.posts[0].username,
|
||||
url: attrs.posts[0].usernameUrl,
|
||||
template: firstUserPost.avatar_template,
|
||||
username: firstUserPost.username,
|
||||
url: firstUserPost.usernameUrl,
|
||||
})
|
||||
),
|
||||
this.attach("poster-name", attrs.posts[0]),
|
||||
this.attach("poster-name", firstUserPost),
|
||||
this.attach("filter-show-all", attrs),
|
||||
];
|
||||
}
|
||||
|
@ -282,6 +284,7 @@ export default createWidget("post-stream", {
|
|||
this.attach("posts-filtered-notice", {
|
||||
posts: postArray,
|
||||
streamFilters: attrs.streamFilters,
|
||||
filteredPostsCount: attrs.filteredPostsCount,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user