Merge pull request #1876 from maeeeeee/group-img-fix
Fix broken avatar thumbnail upon deleting last member of a group
This commit is contained in:
commit
d0d6a7edb9
|
@ -598,6 +598,11 @@ function getGroupAvatar(group) {
|
|||
return groupAvatar;
|
||||
}
|
||||
|
||||
// catch edge case where group had one member and that member is deleted
|
||||
if (avatarCount === 0) {
|
||||
return $('<div class="missing-avatar fa-solid fa-user-slash"></div>');
|
||||
}
|
||||
|
||||
// default avatar
|
||||
const groupAvatar = $('#group_avatars_template .collage_1').clone();
|
||||
groupAvatar.find('.img_1').attr('src', group.avatar_url || system_avatar);
|
||||
|
|
Loading…
Reference in New Issue