people: Extract helper functions for medium avatar urls.

The new is obviously parallel with the small avatar URL construction,
and allows us to deduplicate this construction between the popovers
and full user profile logic for getting a medium avatar URL.

Fixes #20140.
This commit is contained in:
somesh202
2021-11-06 11:53:26 +05:30
committed by Tim Abbott
parent e9d80390cc
commit 219ecea659
5 changed files with 29 additions and 6 deletions

View File

@@ -158,8 +158,7 @@ function init_email_tooltip(user) {
}
function load_medium_avatar(user, elt) {
const avatar_path = "avatar/" + user.user_id + "/medium?v=" + user.avatar_version;
const user_avatar_url = new URL(avatar_path, window.location.href);
const user_avatar_url = people.medium_avatar_url_for_person(user);
const sender_avatar_medium = new Image();
sender_avatar_medium.src = user_avatar_url;