Skip to content

Commit

Permalink
edit loading logic on discussion loading
Browse files Browse the repository at this point in the history
  • Loading branch information
tima101 committed Nov 13, 2018
1 parent 11f62f5 commit 2a77a9b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/pages/discussion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ class DiscussionComp extends React.Component<Props> {

const discussion = this.getDiscussion(this.props.discussionSlug);

if (discussion && discussion.isLoadingPosts && discussion.posts.length === 0) {
return <p>Empty discussion</p>;
if (discussion && discussion.isLoadingPosts) {
return <p>Loading Posts...</p>;
}

if (discussion && !discussion.isLoadingPosts && discussion.posts.length === 0) {
return <p>Empty Discussion.</p>;
}

let loading = 'loading Posts ...';
Expand Down

0 comments on commit 2a77a9b

Please sign in to comment.