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

Commit

Permalink
Merge pull request #3062 from withspectrum/2.2.11
Browse files Browse the repository at this point in the history
2.2.11
  • Loading branch information
brianlovin authored May 10, 2018
2 parents 5219872 + ebd0793 commit 6b0e4fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Spectrum",
"version": "2.2.10",
"version": "2.2.11",
"license": "BSD-3-Clause",
"devDependencies": {
"babel-cli": "^6.24.1",
Expand Down
16 changes: 10 additions & 6 deletions src/components/message/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ export class QuotedMessage extends React.Component<
constructor(props: QuotedMessageProps) {
super(props);

const jsonBody = JSON.parse(props.message.content.body);
const isShort =
!jsonBody.blocks.length > 1 ||
toPlainText(toState(jsonBody)).length <= 170;
const isShort = () => {
if (props.message.messageType === 'media') return false;
const jsonBody = JSON.parse(props.message.content.body);
return (
!jsonBody.blocks.length > 1 ||
toPlainText(toState(jsonBody)).length <= 170
);
};

this.state = {
isShort,
isExpanded: isShort,
isShort: isShort(),
isExpanded: isShort(),
};
}

Expand Down

0 comments on commit 6b0e4fd

Please sign in to comment.