Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit 6b0e4fd

Browse files
authored
Merge pull request #3062 from withspectrum/2.2.11
2.2.11
2 parents 5219872 + ebd0793 commit 6b0e4fd

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Spectrum",
3-
"version": "2.2.10",
3+
"version": "2.2.11",
44
"license": "BSD-3-Clause",
55
"devDependencies": {
66
"babel-cli": "^6.24.1",

src/components/message/view.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,18 @@ export class QuotedMessage extends React.Component<
8585
constructor(props: QuotedMessageProps) {
8686
super(props);
8787

88-
const jsonBody = JSON.parse(props.message.content.body);
89-
const isShort =
90-
!jsonBody.blocks.length > 1 ||
91-
toPlainText(toState(jsonBody)).length <= 170;
88+
const isShort = () => {
89+
if (props.message.messageType === 'media') return false;
90+
const jsonBody = JSON.parse(props.message.content.body);
91+
return (
92+
!jsonBody.blocks.length > 1 ||
93+
toPlainText(toState(jsonBody)).length <= 170
94+
);
95+
};
9296

9397
this.state = {
94-
isShort,
95-
isExpanded: isShort,
98+
isShort: isShort(),
99+
isExpanded: isShort(),
96100
};
97101
}
98102

0 commit comments

Comments
 (0)