fix(front): delete edit and upload buttons from library detail page. Fixing undefined errors
This commit is contained in:
parent
4c1388af5d
commit
b0d3179f18
|
@ -101,7 +101,7 @@ const updateUploads = (count: number) => {
|
|||
<Loader v-if="isLoading" />
|
||||
<Header
|
||||
page-heading
|
||||
:h1="object.name"
|
||||
:h1="object?.name"
|
||||
>
|
||||
<template #action>
|
||||
<Popover>
|
||||
|
@ -113,12 +113,12 @@ const updateUploads = (count: number) => {
|
|||
|
||||
<template #items>
|
||||
<PopoverItem
|
||||
v-if="object.actor.domain != store.getters['instance/domain']"
|
||||
:to="object.fid"
|
||||
v-if="object?.actor.domain != store.getters['instance/domain']"
|
||||
:to="object?.fid"
|
||||
target="_blank"
|
||||
icon="bi-box-arrow-up-right"
|
||||
>
|
||||
{{ t('views.library.LibraryBase.link.domain', {domain: object.actor.domain}) }}
|
||||
{{ t('views.library.LibraryBase.link.domain', {domain: object?.actor.domain}) }}
|
||||
</PopoverItem>
|
||||
<PopoverItem
|
||||
v-for="obj in getReportableObjects({library: object})"
|
||||
|
@ -134,7 +134,7 @@ const updateUploads = (count: number) => {
|
|||
<PopoverItem
|
||||
v-if="store.state.auth.availablePermissions['moderation']"
|
||||
icon="bi-wrench"
|
||||
:to="{name: 'manage.library.libraries.detail', params: {id: object.uuid}}"
|
||||
:to="{name: 'manage.library.libraries.detail', params: {id: object?.uuid}}"
|
||||
>
|
||||
{{ t('views.library.LibraryBase.link.moderation') }}
|
||||
</PopoverItem>
|
||||
|
@ -144,33 +144,33 @@ const updateUploads = (count: number) => {
|
|||
</Header>
|
||||
<div
|
||||
class="sub header ellipsis"
|
||||
:title="object.actor.full_username"
|
||||
:title="object?.actor.full_username"
|
||||
>
|
||||
<actor-link
|
||||
:avatar="false"
|
||||
:actor="object.actor"
|
||||
:actor="object?.actor"
|
||||
:truncate-length="0"
|
||||
>
|
||||
{{ t('views.library.LibraryBase.link.owner', {username: object.actor.full_username}) }}
|
||||
{{ t('views.library.LibraryBase.link.owner', {username: object?.actor.full_username}) }}
|
||||
</actor-link>
|
||||
</div>
|
||||
<Layout flex>
|
||||
<span
|
||||
v-if="object.privacy_level === 'me'"
|
||||
v-if="object?.privacy_level === 'me'"
|
||||
:title="labels.tooltips.me"
|
||||
>
|
||||
<i class="bi bi-lock" />
|
||||
{{ labels.visibility.me }}
|
||||
</span>
|
||||
<span
|
||||
v-else-if="object.privacy_level === 'instance'"
|
||||
v-else-if="object?.privacy_level === 'instance'"
|
||||
:title="labels.tooltips.instance"
|
||||
>
|
||||
<i class="bi bi-lock-open" />
|
||||
{{ labels.visibility.instance }}
|
||||
</span>
|
||||
<span
|
||||
v-else-if="object.privacy_level === 'everyone'"
|
||||
v-else-if="object?.privacy_level === 'everyone'"
|
||||
:title="labels.tooltips.everyone"
|
||||
class="bi bi-dot"
|
||||
>
|
||||
|
@ -181,9 +181,9 @@ const updateUploads = (count: number) => {
|
|||
<i class="bi bi-music-note-list" />
|
||||
{{ t('views.library.LibraryBase.meta.tracks', object.uploads_count) }}
|
||||
</span>
|
||||
<span v-if="object.size">
|
||||
<span v-if="object?.size">
|
||||
<i class="bi bi-database-fill" />
|
||||
{{ humanSize(object.size) }}
|
||||
{{ humanSize(object?.size) }}
|
||||
</span>
|
||||
</Layout>
|
||||
|
||||
|
@ -194,7 +194,7 @@ const updateUploads = (count: number) => {
|
|||
<radio-button
|
||||
:disabled="!isPlayable || null"
|
||||
type="library"
|
||||
:object-id="object.uuid"
|
||||
:object-id="object?.uuid"
|
||||
/>
|
||||
<div
|
||||
v-if="!isOwner"
|
||||
|
@ -207,14 +207,14 @@ const updateUploads = (count: number) => {
|
|||
</Layout>
|
||||
|
||||
<rendered-description
|
||||
:content="object.description ? {html: object.description} : null"
|
||||
:update-url="`channels/${object.uuid}/`"
|
||||
:content="object?.description ? {html: object?.description} : null"
|
||||
:update-url="`channels/${object?.uuid}/`"
|
||||
:can-update="false"
|
||||
/>
|
||||
<Layout form>
|
||||
<div class="field">
|
||||
<copy-input
|
||||
:value="object.fid"
|
||||
:value="object?.fid"
|
||||
:label="t('views.library.LibraryBase.label.sharingLink')"
|
||||
/>
|
||||
<p>
|
||||
|
@ -256,26 +256,6 @@ const updateUploads = (count: number) => {
|
|||
@uploads-finished="updateUploads"
|
||||
/>
|
||||
</Tab>
|
||||
<template #tabs-right>
|
||||
<Layout flex>
|
||||
<Button
|
||||
secondary
|
||||
tiny
|
||||
icon="bi-upload"
|
||||
:to="{name: 'library.detail.upload'}"
|
||||
>
|
||||
{{ t('views.library.LibraryBase.button.upload') }}
|
||||
</Button>
|
||||
<Button
|
||||
primary
|
||||
tiny
|
||||
icon="bi-pencil"
|
||||
:to="{name: 'library.detail.edit'}"
|
||||
>
|
||||
{{ t('views.library.LibraryBase.button.edit') }}
|
||||
</Button>
|
||||
</Layout>
|
||||
</template>
|
||||
</Tabs>
|
||||
</Layout>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue