From 093484eab3f9971abcf5bea2c5968c21a5c2c3e2 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 28 Sep 2018 11:54:41 -0300 Subject: [PATCH] Do not show a loading spinner if thread has root post loaded (#2186) * Do not show a loading spinner if thread has root post loaded * Feedback review * Remove additional condition --- app/screens/thread/thread.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/app/screens/thread/thread.js b/app/screens/thread/thread.js index da2a98143..380e90a96 100644 --- a/app/screens/thread/thread.js +++ b/app/screens/thread/thread.js @@ -86,16 +86,21 @@ class Thread extends PureComponent { hasRootPost = () => { return this.props.postIds.includes(this.props.rootId); - } + }; renderFooter = () => { if (!this.hasRootPost() && this.props.threadLoadingStatus.status !== RequestStatus.STARTED) { return ( ); + } else if (this.props.threadLoadingStatus.status === RequestStatus.STARTED) { + return ( + + ); } + return null; - } + }; onCloseChannel = () => { this.props.navigator.resetTo({ @@ -112,7 +117,7 @@ class Thread extends PureComponent { screenBackgroundColor: 'transparent', }, }); - } + }; render() { const { @@ -126,11 +131,8 @@ class Thread extends PureComponent { } = this.props; const style = getStyle(theme); let content; - if (this.props.threadLoadingStatus.status === RequestStatus.STARTED) { - content = ( - - ); - } else { + let postTextBox; + if (this.hasRootPost()) { content = ( ); - } - let postTextBox; - if (this.hasRootPost() && this.props.threadLoadingStatus.status !== RequestStatus.STARTED) { + postTextBox = ( ); + } else { + content = ( + + ); } return (