From 60a4819fbeabcb96b95fcaa6da92a6687a0778bd Mon Sep 17 00:00:00 2001 From: bakape Date: Sun, 21 Apr 2019 14:29:05 +0300 Subject: [PATCH] client: Fix live image count updates --- client/client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/client.ts b/client/client.ts index 87fb9f664..37baa52ca 100644 --- a/client/client.ts +++ b/client/client.ts @@ -51,7 +51,7 @@ export function insertPost(data: PostData) { if (existing) { if (existing instanceof FormModel) { existing.onAllocation(data) - incrementPostCount(true, "image" in data) + incrementPostCount(true, !!data["image"]); } return } @@ -77,7 +77,7 @@ export function insertPost(data: PostData) { } postAdded(model) - incrementPostCount(true, "image" in data) + incrementPostCount(true, !!data["image"]); lightenThread(); } @@ -96,7 +96,7 @@ export default () => { handlers[message.insertImage] = (msg: ImageMessage) => handle(msg.id, m => { delete msg.id - if (!("image" in m)) { + if (!m.image) { incrementPostCount(false, true) } m.insertImage(msg)