aboutsummaryrefslogtreecommitdiff
path: root/src/components/status_content
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-07-06 14:01:03 +0300
committerShpuld Shpuldson <shp@cock.li>2020-07-06 14:01:03 +0300
commit87b5f828d769a5b2c34a4ad61f249c314a8bbb23 (patch)
treef09e6fce0c7549470d31d201534040df155c7fd2 /src/components/status_content
parent4d25be7cb35f86ba2abe883116dc6442c93a1d9d (diff)
parentb761bcf3334e1f464e63a87de40eb75d0906d545 (diff)
fix conflicts, use file icon instead of link, add support for audio and file icon in cw'd posts
Diffstat (limited to 'src/components/status_content')
-rw-r--r--src/components/status_content/status_content.js12
-rw-r--r--src/components/status_content/status_content.vue12
2 files changed, 13 insertions, 11 deletions
diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js
index 09ea3a20..2b9ea50c 100644
--- a/src/components/status_content/status_content.js
+++ b/src/components/status_content/status_content.js
@@ -99,15 +99,9 @@ const StatusContent = {
file => !fileType.fileMatchesSomeType(this.galleryTypes, file)
)
},
- hasImageAttachments () {
- return this.status.attachments.some(
- file => fileType.fileType(file.mimetype) === 'image'
- )
- },
- hasVideoAttachments () {
- return this.status.attachments.some(
- file => fileType.fileType(file.mimetype) === 'video'
- )
+ attachmentTypes () {
+ console.log(this.status.attachments)
+ return this.status.attachments.map(file => fileType.fileType(file.mimetype))
},
maxThumbnails () {
return this.mergedConfig.maxThumbnails
diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue
index 3460c2fa..5a4b4f1e 100644
--- a/src/components/status_content/status_content.vue
+++ b/src/components/status_content/status_content.vue
@@ -55,14 +55,22 @@
>
{{ $t("status.show_content") }}
<span
- v-if="hasImageAttachments"
+ v-if="attachmentTypes.includes('image')"
class="icon-picture"
/>
<span
- v-if="hasVideoAttachments"
+ v-if="attachmentTypes.includes('video')"
class="icon-video"
/>
<span
+ v-if="attachmentTypes.includes('audio')"
+ class="icon-music"
+ />
+ <span
+ v-if="attachmentTypes.includes('unknown')"
+ class="icon-doc"
+ />
+ <span
v-if="status.card"
class="icon-link"
/>