Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

Commit

Permalink
client: Fix live image count updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bakape committed Apr 21, 2019
1 parent d8fdb83 commit 60a4819
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -77,7 +77,7 @@ export function insertPost(data: PostData) {
}

postAdded(model)
incrementPostCount(true, "image" in data)
incrementPostCount(true, !!data["image"]);
lightenThread();
}

Expand All @@ -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)
Expand Down

0 comments on commit 60a4819

Please sign in to comment.