From 764ff4cb64eb86c87a28a076eed28d8778f194d6 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 13 Jul 2017 19:55:45 -0400 Subject: PLT-7116/PLT-7126 Some final release fixes (#6933) * Some final release fixes * Fix team switching with image in channel bug --- webapp/components/admin_console/saml_settings.jsx | 6 +++--- webapp/components/markdown_image.jsx | 2 +- webapp/components/post_view/post_list.jsx | 11 ++++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/admin_console/saml_settings.jsx b/webapp/components/admin_console/saml_settings.jsx index 4c0c0c8fd..2358660da 100644 --- a/webapp/components/admin_console/saml_settings.jsx +++ b/webapp/components/admin_console/saml_settings.jsx @@ -77,15 +77,15 @@ export default class SamlSettings extends AdminSettings { AdminActions.samlCertificateStatus( (data) => { const files = {}; - if (!data.IdpCertificateFile) { + if (!data.idp_certificate_file) { files.idpCertificateFile = ''; } - if (!data.PublicCertificateFile) { + if (!data.public_certificate_file) { files.publicCertificateFile = ''; } - if (!data.PrivateKeyFile) { + if (!data.private_key_file) { files.privateKeyFile = ''; } this.setState(files); diff --git a/webapp/components/markdown_image.jsx b/webapp/components/markdown_image.jsx index 4d8635457..2634ef3f6 100644 --- a/webapp/components/markdown_image.jsx +++ b/webapp/components/markdown_image.jsx @@ -39,7 +39,7 @@ export default class MarkdownImage extends React.PureComponent { waitForHeight = () => { if (this.refs.image.height) { - postListScrollChange(); + setTimeout(postListScrollChange, 0); this.heightTimeout = 0; } else { diff --git a/webapp/components/post_view/post_list.jsx b/webapp/components/post_view/post_list.jsx index c42c62377..d8a56fe83 100644 --- a/webapp/components/post_view/post_list.jsx +++ b/webapp/components/post_view/post_list.jsx @@ -181,6 +181,10 @@ export default class PostList extends React.PureComponent { const posts = this.props.posts; const postList = this.refs.postlist; + if (!postList) { + return; + } + // Scroll to focused post on first load const focusedPost = this.refs[this.props.focusedPostId]; if (focusedPost && this.props.posts) { @@ -262,7 +266,7 @@ export default class PostList extends React.PureComponent { checkBottom = () => { if (!this.refs.postlist) { - return false; + return true; } // No scroll bar so we're at the bottom @@ -329,7 +333,12 @@ export default class PostList extends React.PureComponent { handleScroll = () => { // Only count as user scroll if we've already performed our first load scroll this.hasScrolled = this.hasScrolledToNewMessageSeparator || this.hasScrolledToFocusedPost; + if (!this.refs.postlist) { + return; + } + this.previousScrollTop = this.refs.postlist.scrollTop; + if (this.refs.postlist.scrollHeight === this.previousScrollHeight) { this.atBottom = this.checkBottom(); } -- cgit v1.2.3-1-g7c22