diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 50f5a7e..7b777e3 100644 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -122,7 +122,7 @@ class ProfilePage extends Component { loadMoreTimelinePieces() { const { match: {params}} = this.props; this.setState({ viewDidLoad: false, viewIsLoading: true}) - if (this.state.posts) { + if (this.state.posts && this.state.posts.length > 0) { this.client.get(`/accounts/${params.profileId}/statuses`, { max_id: this.state.posts[this.state.posts.length - 1].id, limit: 20 }).then((resp: any) => { let newPosts: [Status] = resp.data; let posts = this.state.posts as [Status]; @@ -150,9 +150,11 @@ class ProfilePage extends Component { variant: 'error', }); }) + } else { + this.props.enqueueSnackbar("Reached end of posts", { variant: 'error'} ); } - } - + } + toggleFollow() { if (this.state.relationship) { if (this.state.relationship.following) {