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 <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad committed Dec 13, 2023
1 parent bb89b3f commit 8cd8745
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ export default {
// Fallback for loading mimeicons (preview for audio files is not provided)
if (this.previewAvailable !== 'yes' || this.mimetype.startsWith('audio/')) {
return {
width: '128px',
height: '128px',
width: this.smallPreview ? '32px' : '128px',
height: this.smallPreview ? '32px' : '128px',
}
}
Expand Down
16 changes: 12 additions & 4 deletions src/components/Quote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ components.
<!-- file preview-->
<NcRichText v-if="isFileShareMessage"
text="{file}"
class="quote__file-preview"
:arguments="richParameters" />
<!-- text -->
<blockquote v-if="!isFileShareWithoutCaption"
Expand Down Expand Up @@ -146,6 +145,12 @@ export default {
return { AVATAR }
},
data() {
return {
mimetype: '',
}
},
computed: {
/**
* The message actor display name.
Expand Down Expand Up @@ -184,11 +189,13 @@ 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({
token: this.token,
smallPreview: true,
rowLayout: !this.mimetype.startsWith('image/'),
}, this.messageParameters[p]),
}
} else {
Expand All @@ -201,6 +208,10 @@ export default {
return richParameters
},
isImageWithCaption() {
return this.isFileShareMessage && 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,9 +339,6 @@ export default {
position: relative;
margin: auto;
}
&__file-preview {
line-height: 0.5 !important;
}
}
</style>

0 comments on commit 8cd8745

Please sign in to comment.