fix(front): undefined and value errors

This commit is contained in:
ArneBo 2025-02-14 02:21:52 +01:00
parent 28fee830b1
commit 97f9b0b9d0
3 changed files with 12 additions and 7 deletions

View File

@ -94,7 +94,7 @@ const editListFilters = computed(() => showPendingReview.value
const values = reactive({} as Record<string, any>)
const initialValues = reactive({} as Record<string, any>)
for (const { id, getValue } of config.value.fields) {
for (const { id, getValue } of config.value?.fields) {
values[id] = clone(getValue(props.object))
initialValues[id] = clone(values[id])
}

View File

@ -72,8 +72,8 @@ const downloadUrl = computed(() => {
const attributedToUrl = computed(() => router.resolve({
name: 'profile.full.overview',
params: {
username: track.value?.attributed_to.preferred_username,
domain: track.value?.attributed_to.domain
username: track.value?.attributed_to?.preferred_username,
domain: track.value?.attributed_to?.domain
}
})?.href)
@ -134,6 +134,12 @@ watch(showDeleteModal, (newValue) => {
/>
<template v-if="track">
<Layout flex>
<img
v-if="track.cover"
v-lazy="store.getters['instance/absoluteUrl'](track.cover.urls.large_square_crop)"
alt=""
class="channel-image"
>
<img
v-if="track.album && track.album.cover"
v-lazy="store.getters['instance/absoluteUrl'](track.album.cover.urls.large_square_crop)"

View File

@ -27,7 +27,6 @@ interface Props {
track: Track
}
const store = useStore()
const { t } = useI18n()
const emit = defineEmits<Events>()
@ -110,12 +109,12 @@ const track_details: {
}[] = [
{
label: t('components.library.TrackDetail.table.track.duration'),
track_value: upload?.value.duration ? time.parse(upload.duration) : t('components.library.TrackDetail.notApplicable')
track_value: upload?.value.duration ? time.parse(upload.value.duration) : t('components.library.TrackDetail.notApplicable')
},
{
label:
t('components.library.TrackDetail.table.track.size'),
track_value: upload?.value.size ? humanSize(upload.size) : t('components.library.TrackDetail.notApplicable')
track_value: upload?.value.size ? humanSize(upload.value.size) : t('components.library.TrackDetail.notApplicable')
},
{
label: t('components.library.TrackDetail.table.track.codec'),
@ -125,7 +124,7 @@ const track_details: {
label:
t('components.library.TrackDetail.table.track.bitrate.label'),
track_value: upload?.value.bitrate
? t('components.library.TrackDetail.table.track.bitrate.value', {bitrate: humanSize(upload.bitrate)})
? t('components.library.TrackDetail.table.track.bitrate.value', {bitrate: humanSize(upload.value.bitrate)})
: t('components.library.TrackDetail.notApplicable')
},
{