From 44b589d04fe7569a4cc528f4d98b40fec3435d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Curcio?= Date: Thu, 4 Oct 2018 15:52:25 -0300 Subject: [PATCH] Correct optimitic updates --- .../stream/mutations/CreateCommentReactionMutation.ts | 6 +++++- .../stream/mutations/DeleteCommentReactionMutation.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/client/stream/mutations/CreateCommentReactionMutation.ts b/src/core/client/stream/mutations/CreateCommentReactionMutation.ts index 9621ebdfb..ef0b7a61a 100644 --- a/src/core/client/stream/mutations/CreateCommentReactionMutation.ts +++ b/src/core/client/stream/mutations/CreateCommentReactionMutation.ts @@ -48,7 +48,11 @@ function commit(environment: Environment, input: CreateCommentReactionInput) { myActionPresence: { reaction: true, }, - actionCounts: currentCount + 1, + actionCounts: { + reaction: { + total: currentCount + 1, + }, + }, }, clientMutationId: (clientMutationId++).toString(), }, diff --git a/src/core/client/stream/mutations/DeleteCommentReactionMutation.ts b/src/core/client/stream/mutations/DeleteCommentReactionMutation.ts index a485433de..027723544 100644 --- a/src/core/client/stream/mutations/DeleteCommentReactionMutation.ts +++ b/src/core/client/stream/mutations/DeleteCommentReactionMutation.ts @@ -42,7 +42,11 @@ function commit(environment: Environment, input: CreateCommentReactionInput) { myActionPresence: { reaction: false, }, - actionCounts: currentCount - 1, + actionCounts: { + reaction: { + total: currentCount - 1, + }, + }, }, clientMutationId: clientMutationId.toString(), },