Fixed actor edit page breaking if no avatar is available.

This commit is contained in:
DebaucheryLibrarian 2024-10-23 03:08:44 +02:00
parent 254050ec80
commit 760cef3551
1 changed files with 6 additions and 4 deletions

View File

@ -638,13 +638,15 @@ const bustSizes = {
bustSizes.uk = bustSizes.us; bustSizes.uk = bustSizes.us;
bustSizes.jp = bustSizes.eu; bustSizes.jp = bustSizes.eu;
const avatars = Object.values(Object.fromEntries(actor.value.profiles.filter((profile) => !!profile.avatar).map((profile) => [profile.avatar.id, profile.avatar])));
const fields = computed(() => [ const fields = computed(() => [
{ ...(avatars.length > 0 ? [{
key: 'avatar', key: 'avatar',
type: 'avatar', type: 'avatar',
value: actor.value.avatar.id, value: actor.value.avatar?.id,
options: Object.values(Object.fromEntries(actor.value.profiles.filter((profile) => !!profile.avatar).map((profile) => [profile.avatar.id, profile.avatar]))), options: avatars,
}, }] : []),
...(user.role === 'admin' ...(user.role === 'admin'
? [{ ? [{
key: 'name', key: 'name',