From 4ce70f86fb003c9dceb8c3e60e0b329cc1c9d378 Mon Sep 17 00:00:00 2001 From: janherich Date: Fri, 5 Jan 2018 16:22:57 +0100 Subject: [PATCH] Remove message data remnants --- src/status_im/ui/screens/home/subs.cljs | 2 +- .../ui/screens/home/views/inner_item.cljs | 23 ++++++++----------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/status_im/ui/screens/home/subs.cljs b/src/status_im/ui/screens/home/subs.cljs index 8a696f182a..0de287c8fe 100644 --- a/src/status_im/ui/screens/home/subs.cljs +++ b/src/status_im/ui/screens/home/subs.cljs @@ -9,7 +9,7 @@ (not= (str/index-of name text) nil))) (reg-sub :filtered-chats - :<- [:get :chats] + :<- [:chats] :<- [:get-in [:toolbar-search :text]] :<- [:get-in [:toolbar-search :show]] (fn [[chats search-text show-search]] diff --git a/src/status_im/ui/screens/home/views/inner_item.cljs b/src/status_im/ui/screens/home/views/inner_item.cljs index e3adbf4f0a..379f10e192 100644 --- a/src/status_im/ui/screens/home/views/inner_item.cljs +++ b/src/status_im/ui/screens/home/views/inner_item.cljs @@ -54,20 +54,15 @@ content])])})) (defview message-status [{:keys [chat-id contacts]} - {:keys [message-id message-status user-statuses message-type outgoing] :as msg}] - (letsubs [app-db-message-status-value [:get-in [:message-data :statuses message-id :status]]] - (let [delivery-status (get-in user-statuses [chat-id :status])] - (when (and outgoing - (or (some #(= (keyword %) :seen) [delivery-status - message-status - app-db-message-status-value]) - (and (= (keyword message-type) :group-user-message) - (and (= (count user-statuses) (count contacts)) - (every? (fn [[_ {:keys [status]}]] - (= (keyword status) :seen)) user-statuses))) - (= chat-id const/console-chat-id))) - [react/image {:source {:uri :icon_ok_small} - :style st/status-image}])))) + {:keys [message-id user-statuses outgoing] :as msg}] + (letsubs [current-public-key [:get-current-public-key]] + (let [delivery-statuses (dissoc user-statuses current-public-key) + seen-by-everyone (and (= (count delivery-statuses) (count contacts) + (every? (comp (partial = :seen) second) + delivery-statuses)))] + (when (and outgoing (or (= chat-id const/console-chat-id) + seen-by-everyone)) + [vi/icon :icons/ok {:style st/status-image}])))) (defn message-timestamp [{:keys [timestamp]}] (when timestamp