summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/post_list.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-07-13 19:55:45 -0400
committerSaturnino Abril <saturnino.abril@gmail.com>2017-07-14 08:55:45 +0900
commit764ff4cb64eb86c87a28a076eed28d8778f194d6 (patch)
tree129f398480986221537827cb4ea2b127509c5d7b /webapp/components/post_view/post_list.jsx
parentb645bd3211c41db43dcf9360aedb1630be451741 (diff)
downloadchat-764ff4cb64eb86c87a28a076eed28d8778f194d6.tar.gz
chat-764ff4cb64eb86c87a28a076eed28d8778f194d6.tar.bz2
chat-764ff4cb64eb86c87a28a076eed28d8778f194d6.zip
PLT-7116/PLT-7126 Some final release fixes (#6933)
* Some final release fixes * Fix team switching with image in channel bug
Diffstat (limited to 'webapp/components/post_view/post_list.jsx')
-rw-r--r--webapp/components/post_view/post_list.jsx11
1 files changed, 10 insertions, 1 deletions
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();
}