diff options
Diffstat (limited to 'src/components/status')
| -rw-r--r-- | src/components/status/status.js | 10 | ||||
| -rw-r--r-- | src/components/status/status.vue | 9 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index 73d53694..8058e1bb 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -35,7 +35,8 @@ const Status = { expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined' ? !this.$store.state.instance.collapseMessageWithSubject : !this.$store.state.config.collapseMessageWithSubject, - betterShadow: this.$store.state.interface.browserSupport.cssFilter + betterShadow: this.$store.state.interface.browserSupport.cssFilter, + maxAttachments: 9 } }, computed: { @@ -201,7 +202,8 @@ const Status = { }, attachmentSize () { if ((this.$store.state.config.hideAttachments && !this.inConversation) || - (this.$store.state.config.hideAttachmentsInConv && this.inConversation)) { + (this.$store.state.config.hideAttachmentsInConv && this.inConversation) || + (this.status.attachments.length > this.maxAttachments)) { return 'hide' } else if (this.compact) { return 'small' @@ -291,6 +293,10 @@ const Status = { }, userProfileLink (id, name) { return generateProfileLink(id, name, this.$store.state.instance.restrictedNicknames) + }, + setMedia () { + const attachments = this.status.attachments + return () => this.$store.dispatch('setMedia', attachments) } }, watch: { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index af756801..f88b5afb 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -94,7 +94,14 @@ </div> <div v-if='status.attachments && !hideSubjectStatus' class='attachments media-body'> - <attachment :size="attachmentSize" :status-id="status.id" :nsfw="nsfwClickthrough" :attachment="attachment" v-for="attachment in status.attachments" :key="attachment.id"> + <attachment + :size="attachmentSize" + :status-id="status.id" + :nsfw="nsfwClickthrough" + :attachment="attachment" + :set-media="setMedia()" + v-for="attachment in status.attachments" + :key="attachment.id"> </attachment> </div> |
