summaryrefslogtreecommitdiffstats
path: root/webapp/components
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components')
-rw-r--r--webapp/components/file_attachment_list/index.js3
-rw-r--r--webapp/components/post_view/commented_on_files_message/commented_on_files_message.jsx2
-rw-r--r--webapp/components/post_view/commented_on_files_message/index.js2
3 files changed, 4 insertions, 3 deletions
diff --git a/webapp/components/file_attachment_list/index.js b/webapp/components/file_attachment_list/index.js
index b9016defb..1e901114b 100644
--- a/webapp/components/file_attachment_list/index.js
+++ b/webapp/components/file_attachment_list/index.js
@@ -11,7 +11,8 @@ import FileAttachmentList from './file_attachment_list.jsx';
function makeMapStateToProps() {
const selectFilesForPost = makeGetFilesForPost();
return function mapStateToProps(state, ownProps) {
- const fileInfos = selectFilesForPost(state, ownProps.post);
+ const postId = ownProps.post ? ownProps.post.id : '';
+ const fileInfos = selectFilesForPost(state, postId);
let fileCount = 0;
if (ownProps.post.file_ids) {
diff --git a/webapp/components/post_view/commented_on_files_message/commented_on_files_message.jsx b/webapp/components/post_view/commented_on_files_message/commented_on_files_message.jsx
index a8c6845c8..1755d68e4 100644
--- a/webapp/components/post_view/commented_on_files_message/commented_on_files_message.jsx
+++ b/webapp/components/post_view/commented_on_files_message/commented_on_files_message.jsx
@@ -45,7 +45,7 @@ export default class CommentedOnFilesMessage extends React.PureComponent {
id='post_body.plusMore'
defaultMessage=' plus {count, number} other {count, plural, one {file} other {files}}'
values={{
- count: this.props.fileInfos.length
+ count: this.props.fileInfos.length - 1
}}
/>
);
diff --git a/webapp/components/post_view/commented_on_files_message/index.js b/webapp/components/post_view/commented_on_files_message/index.js
index fd6aa7193..d55cff16b 100644
--- a/webapp/components/post_view/commented_on_files_message/index.js
+++ b/webapp/components/post_view/commented_on_files_message/index.js
@@ -15,7 +15,7 @@ function makeMapStateToProps() {
return function mapStateToProps(state, ownProps) {
let fileInfos;
if (ownProps.parentPostId) {
- fileInfos = selectFileInfosForPost(state, {id: ownProps.parentPostId});
+ fileInfos = selectFileInfosForPost(state, ownProps.parentPostId);
}
return {