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.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',
|
||||||
|
|
Loading…
Reference in New Issue