Fixed actor edit page breaking if no avatar is available.
This commit is contained in:
parent
254050ec80
commit
760cef3551
|
@ -638,13 +638,15 @@ const bustSizes = {
|
|||
bustSizes.uk = bustSizes.us;
|
||||
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(() => [
|
||||
{
|
||||
...(avatars.length > 0 ? [{
|
||||
key: 'avatar',
|
||||
type: 'avatar',
|
||||
value: actor.value.avatar.id,
|
||||
options: Object.values(Object.fromEntries(actor.value.profiles.filter((profile) => !!profile.avatar).map((profile) => [profile.avatar.id, profile.avatar]))),
|
||||
},
|
||||
value: actor.value.avatar?.id,
|
||||
options: avatars,
|
||||
}] : []),
|
||||
...(user.role === 'admin'
|
||||
? [{
|
||||
key: 'name',
|
||||
|
|
Loading…
Reference in New Issue