aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-05-25 09:10:20 +0200
committerChocobozzz <me@florianbigard.com>2022-05-25 09:37:30 +0200
commita220b84b0e29c7ce1b32166aec07870696a28ef9 (patch)
treec7dfdbe24a28e5491d6dc103ffc9b10d4f15296a /client/src/app/shared/shared-main
parent424aeb12bd16f5d6763dfa2860d113cc93876405 (diff)
downloadPeerTube-a220b84b0e29c7ce1b32166aec07870696a28ef9.tar.gz
PeerTube-a220b84b0e29c7ce1b32166aec07870696a28ef9.tar.zst
PeerTube-a220b84b0e29c7ce1b32166aec07870696a28ef9.zip
Fix avatars in notifications
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r--client/src/app/shared/shared-main/account/actor.model.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/client/src/app/shared/shared-main/account/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts
index 6be6b75d0..6e45ba588 100644
--- a/client/src/app/shared/shared-main/account/actor.model.ts
+++ b/client/src/app/shared/shared-main/account/actor.model.ts
@@ -21,11 +21,11 @@ export abstract class Actor implements ServerActor {
21 isLocal: boolean 21 isLocal: boolean
22 22
23 static GET_ACTOR_AVATAR_URL (actor: { avatars: { width: number, url?: string, path: string }[] }, size?: number) { 23 static GET_ACTOR_AVATAR_URL (actor: { avatars: { width: number, url?: string, path: string }[] }, size?: number) {
24 const avatars = actor.avatars.sort((a, b) => b.width - a.width) 24 const avatarsAscWidth = actor.avatars.sort((a, b) => a.width - b.width)
25 25
26 const avatar = size 26 const avatar = size
27 ? avatars.find(a => a.width >= size) 27 ? avatarsAscWidth.find(a => a.width >= size)
28 : avatars[0] 28 : avatarsAscWidth[avatarsAscWidth.length - 1] // Bigger one
29 29
30 if (!avatar) return '' 30 if (!avatar) return ''
31 if (avatar.url) return avatar.url 31 if (avatar.url) return avatar.url