[16352] [Bugfix] New message indicator not showing on bottom navigation for unmuted chats and another bug (#16380)

This commit is contained in:
Ibrahem Khalil 2023-06-27 18:44:28 +03:00 committed by GitHub
parent b5a96a254a
commit e0a0c6331f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 23 deletions

View File

@ -56,8 +56,10 @@
(when (and (not locked?) (when (and (not locked?)
muted?) muted?)
[quo2.icons/icon :i/muted [quo2.icons/icon :i/muted
{:size 20 {:size 20
:color colors/neutral-40}]) :color colors/neutral-40
:container-style {:margin-right 1
:margin-top 2}}])
(when (and (not locked?) (when (and (not locked?)
(not muted?) (not muted?)
(pos? (int mentions-count))) (pos? (int mentions-count)))

View File

@ -166,12 +166,11 @@
(defn calculate-unviewed-counts (defn calculate-unviewed-counts
[chats] [chats]
(reduce (fn [acc {:keys [unviewed-mentions-count unviewed-messages-count muted]}] (reduce (fn [acc {:keys [unviewed-mentions-count unviewed-messages-count muted]}]
{:unviewed-messages-count (if-not muted (if-not muted
(+ (:unviewed-messages-count acc) (or unviewed-messages-count 0)) (-> acc
0) (update :unviewed-messages-count + unviewed-messages-count)
:unviewed-mentions-count (if-not muted (update :unviewed-mentions-count + unviewed-mentions-count))
(+ (:unviewed-mentions-count acc) (or unviewed-mentions-count 0)) acc))
0)})
{:unviewed-messages-count 0 {:unviewed-messages-count 0
:unviewed-mentions-count 0} :unviewed-mentions-count 0}
chats)) chats))

View File

@ -190,19 +190,19 @@
(let [{:keys [chats-stack community-stack]} (let [{:keys [chats-stack community-stack]}
(reduce (reduce
(fn [acc [_ {:keys [unviewed-messages-count unviewed-mentions-count chat-type muted]}]] (fn [acc [_ {:keys [unviewed-messages-count unviewed-mentions-count chat-type muted]}]]
(case chat-type (cond
constants/community-chat-type (and (not muted)
(when-not muted (= chat-type constants/community-chat-type))
(-> acc (-> acc
(update-in [:community-stack :unviewed-messages-count] + unviewed-messages-count) (update-in [:community-stack :unviewed-messages-count] + unviewed-messages-count)
(update-in [:community-stack :unviewed-mentions-count] + unviewed-mentions-count))) (update-in [:community-stack :unviewed-mentions-count] + unviewed-mentions-count))
(constants/private-group-chat-type constants/one-to-one-chat-type)
(when-not muted
(-> acc
(update-in [:chats-stack :unviewed-messages-count] + unviewed-messages-count)
(update-in [:chats-stack :unviewed-mentions-count] + unviewed-mentions-count)))
(and (not muted)
(#{constants/private-group-chat-type constants/one-to-one-chat-type} chat-type))
(-> acc
(update-in [:chats-stack :unviewed-messages-count] + unviewed-messages-count)
(update-in [:chats-stack :unviewed-mentions-count] + unviewed-mentions-count))
:else
acc)) acc))
{:chats-stack {:unviewed-messages-count 0 :unviewed-mentions-count 0} {:chats-stack {:unviewed-messages-count 0 :unviewed-mentions-count 0}
:community-stack {:unviewed-messages-count 0 :unviewed-mentions-count 0}} :community-stack {:unviewed-messages-count 0 :unviewed-mentions-count 0}}

View File

@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>", "_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im", "owner": "status-im",
"repo": "status-go", "repo": "status-go",
"version": "v0.159.6", "version": "v0.159.7",
"commit-sha1": "f23cb4065bce9cff3cb8174a10bf9d8d49a4789f", "commit-sha1": "323e02eb1708a30cb0c566b876f511001e3e2c0e",
"src-sha256": "1yv24cqj2gnf2rgws39vc0j54l0dfxa6vc74iqcxgm50gd73gf6s" "src-sha256": "1kxpv05kkdvlnb2n0abd6wmxk3f3cw3a4pspsvsbwyn5jparvbkq"
} }