mirror of https://github.com/zulip/zulip.git
user_card_popover: Fix bug where owner's avatar replaces bot's avatar.
The `.popover-menu-user-avatar` selector being used to replace the small avatar with the medium avatar was a broad selector, which also targeted the bot's avatar when the bot owner's user card was opened. This commit fixes this bug by scoping the selector to the current popover instance.
This commit is contained in:
parent
8734d34cb7
commit
9b314da0ea
|
@ -334,6 +334,7 @@ function show_user_card_popover(
|
|||
if (on_mount) {
|
||||
on_mount(instance);
|
||||
}
|
||||
const $popover = $(instance.popper);
|
||||
// Note: We pass the normal-size avatar in initial rendering, and
|
||||
// then query the server to replace it with the medium-size
|
||||
// avatar. The purpose of this double-fetch approach is to take
|
||||
|
@ -341,7 +342,7 @@ function show_user_card_popover(
|
|||
// low-resolution image cached and thus display a low-resolution
|
||||
// avatar rather than a blank area during the network delay for
|
||||
// fetching the medium-size one.
|
||||
load_medium_avatar(user, $(".popover-menu-user-avatar"));
|
||||
load_medium_avatar(user, $popover.find(".popover-menu-user-avatar"));
|
||||
init_email_clipboard();
|
||||
init_email_tooltip(user);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue