Skip to content

Commit

Permalink
fix(Quote): don't trim the quote when it is not image share with caption
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad committed Dec 8, 2023
1 parent 92297f0 commit e646e2e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/Quote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ components.
<!-- file preview-->
<NcRichText v-if="isFileShareMessage"
text="{file}"
class="quote__file-preview"
:class="{'quote__image-preview' : isImageWithCaption}"
:arguments="richParameters" />
<!-- text -->
<blockquote v-if="!isFileShareWithoutCaption"
Expand Down Expand Up @@ -146,6 +146,12 @@ export default {
return { AVATAR }
},
data() {
return {
mimetype: '',
}
},
computed: {
/**
* The message actor display name.
Expand Down Expand Up @@ -184,6 +190,7 @@ export default {
Object.keys(this.messageParameters).forEach(function(p) {
const type = this.messageParameters[p].type
if (type === 'file') {
this.mimetype = this.messageParameters[p].mimetype
richParameters[p] = {
component: FilePreview,
props: Object.assign({
Expand All @@ -201,6 +208,10 @@ export default {
return richParameters
},
isImageWithCaption() {
return this.mimetype.startsWith('image/') && this.message !== '{file}'
},
/**
* This is a simplified version of the last chat message.
* Parameters are parsed without markup (just replaced with the name),
Expand Down Expand Up @@ -328,7 +339,7 @@ export default {
position: relative;
margin: auto;
}
&__file-preview {
&__image-preview {
line-height: 0.5 !important;
}
}
Expand Down

0 comments on commit e646e2e

Please sign in to comment.