diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js index 3eb12b04f..b66deb18c 100644 --- a/client/coral-embed-stream/src/Embed.js +++ b/client/coral-embed-stream/src/Embed.js @@ -78,9 +78,14 @@ class Embed extends Component { } loadMoreComments = () => { + + if (!this.props.asset.comments.length) { + return; + } + this.props.loadMore({ limit: 10, - cursor: new Date(), + cursor: this.props.asset.comments[this.props.asset.comments.length - 1].created_at, asset_id: this.props.asset.id, sort: 'REVERSE_CHRONOLOGICAL' }) diff --git a/client/coral-framework/graphql/queries/index.js b/client/coral-framework/graphql/queries/index.js index 7916b9b28..831d3512c 100644 --- a/client/coral-framework/graphql/queries/index.js +++ b/client/coral-framework/graphql/queries/index.js @@ -35,13 +35,14 @@ export const queryStream = graphql(STREAM_QUERY, { asset_id, sort }, - updateQuery: ({asset}, {fetchMoreResult:{data:{new_top_level_comments}}}) => { - const comments = asset.comments.concat(new_top_level_comments); + updateQuery: (oldData, {fetchMoreResult:{data:{new_top_level_comments}}}) => { + const asset = { + ...oldData.asset, + comments: [...oldData.asset.comments, ...new_top_level_comments] + }; return { - asset: { - ...asset, - comments - } + ...oldData, + asset }; } }); diff --git a/client/coral-sign-in/components/SignInContent.js b/client/coral-sign-in/components/SignInContent.js index c7a5dc80d..eebaf960b 100644 --- a/client/coral-sign-in/components/SignInContent.js +++ b/client/coral-sign-in/components/SignInContent.js @@ -97,7 +97,7 @@ const SignInContent = ({ SignInContent.propTypes = { auth: PropTypes.shape({ isLoading: PropTypes.bool.isRequired, - error: PropTypes.object, + error: PropTypes.string, emailVerificationFailure: PropTypes.bool }).isRequired, fetchSignInFacebook: PropTypes.func.isRequired,