diff --git a/src/core/client/stream/mutations/CreateCommentReactionMutation.ts b/src/core/client/stream/mutations/CreateCommentReactionMutation.ts index f0e079e7d..9621ebdfb 100644 --- a/src/core/client/stream/mutations/CreateCommentReactionMutation.ts +++ b/src/core/client/stream/mutations/CreateCommentReactionMutation.ts @@ -29,7 +29,6 @@ let clientMutationId = 0; function commit(environment: Environment, input: CreateCommentReactionInput) { const source = environment.getStore().getSource(); - const currentCount = source.get( source.get(source.get(input.commentID)!.actionCounts.__ref)!.reaction.__ref )!.total; @@ -49,7 +48,7 @@ function commit(environment: Environment, input: CreateCommentReactionInput) { myActionPresence: { reaction: true, }, - actionCounts: currentCount, + actionCounts: currentCount + 1, }, clientMutationId: (clientMutationId++).toString(), }, diff --git a/src/core/client/stream/mutations/DeleteCommentReactionMutation.ts b/src/core/client/stream/mutations/DeleteCommentReactionMutation.ts index 9e032f296..a485433de 100644 --- a/src/core/client/stream/mutations/DeleteCommentReactionMutation.ts +++ b/src/core/client/stream/mutations/DeleteCommentReactionMutation.ts @@ -23,6 +23,10 @@ const mutation = graphql` const clientMutationId = 0; function commit(environment: Environment, input: CreateCommentReactionInput) { + const source = environment.getStore().getSource(); + const currentCount = source.get( + source.get(source.get(input.commentID)!.actionCounts.__ref)!.reaction.__ref + )!.total; return commitMutationPromiseNormalized(environment, { mutation, variables: { @@ -35,6 +39,10 @@ function commit(environment: Environment, input: CreateCommentReactionInput) { deleteCommentReaction: { comment: { id: input.commentID, + myActionPresence: { + reaction: false, + }, + actionCounts: currentCount - 1, }, clientMutationId: clientMutationId.toString(), },