diff --git a/client/coral-framework/graphql/queries/index.js b/client/coral-framework/graphql/queries/index.js index ec0dcc336..32bdfb6c9 100644 --- a/client/coral-framework/graphql/queries/index.js +++ b/client/coral-framework/graphql/queries/index.js @@ -30,13 +30,13 @@ export const getCounts = (data) => ({asset_id, limit, sort}) => { limit, sort }, - updateQuery: (oldData, {fetchMoreResult:{data}}) => { + updateQuery: (oldData, {fetchMoreResult:{asset}}) => { return { ...oldData, asset: { ...oldData.asset, - commentCount: data.asset.commentCount + commentCount: asset.commentCount } }; } @@ -54,8 +54,7 @@ export const loadMore = (data) => ({limit, cursor, parent_id = null, asset_id, s asset_id, // the id of the asset we're currently on sort // CHRONOLOGICAL or REVERSE_CHRONOLOGICAL }, - updateQuery: (oldData, {fetchMoreResult:{data:{new_top_level_comments}}}) => { - + updateQuery: (oldData, {fetchMoreResult:{new_top_level_comments}}) => { let updatedAsset; if (!isNil(oldData.comment)) { // loaded replies on a highlighted (permalinked) comment diff --git a/plugins/coral-plugin-respect/client/containers/RespectButton.js b/plugins/coral-plugin-respect/client/containers/RespectButton.js index f102a00b5..047f7991f 100644 --- a/plugins/coral-plugin-respect/client/containers/RespectButton.js +++ b/plugins/coral-plugin-respect/client/containers/RespectButton.js @@ -102,11 +102,12 @@ const withPostRespect = graphql(gql` }, updateQueries: { RespectQuery: (prev, {mutationResult, queryVariables}) => { - if (queryVariables.commentId !== respect.item_id) { + if (queryVariables.commentId !== respect.item_id || + get(prev, 'comment.action_summaries.0.current_user')) { return prev; } const respectAction = mutationResult.data.createRespect.respect; - const count = prev.action_summaries ? prev.action_summaries.count : 0; + const count = prev.comment.action_summaries[0] ? prev.comment.action_summaries[0].count : 0; const next = { ...prev, comment: { diff --git a/services/users.js b/services/users.js index 1332ff7f0..a86a6686d 100644 --- a/services/users.js +++ b/services/users.js @@ -268,7 +268,7 @@ module.exports = class UsersService { if (checkAgainstWordlist) { // check for profanity - return Wordlist.usernameCheck(username); + console.log('Username profanity check disabled: ', Wordlist.usernameCheck(username)); } // No errors found!