Using actors avatars table for secondary profile photos.

This commit is contained in:
2024-10-26 01:03:30 +02:00
parent 6b5aa9505e
commit a6af10ee20
5 changed files with 40 additions and 19 deletions

View File

@@ -37,10 +37,10 @@
<div
class="photos nobar"
:class="{ 'has-avatar': actor.avatar, 'has-photos': actor.avatar ? photos.length > 1 : photos.length > 0 }"
:class="{ 'has-avatar': actor.avatar, 'has-photos': actor.avatar ? actor.photos.length > 1 : actor.photos.length > 0 }"
>
<div
v-for="photo in photos"
v-for="photo in actor.photos"
:key="`photo-${photo.id}`"
class="photo-container"
:class="{ avatar: photo.isAvatar }"
@@ -92,13 +92,6 @@ const { pageProps, routeParams } = pageContext;
const { actor } = pageProps;
const domain = routeParams.domain;
const photos = Object.values(Object.fromEntries(actor.profiles
.filter((profile) => !!profile.avatar)
.map((profile) => [profile.avatar.id, {
...profile.avatar,
isAvatar: profile.avatar.id === actor.avatar.id,
}])));
</script>
<style scoped>