From b8a491e66da151732e65ba7e3feefb8e121d6d52 Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Sun, 26 Mar 2017 11:58:37 +0300 Subject: [PATCH] fix for https://github.com/status-im/status-react/issues/943 --- src/status_im/data_store/realm/contact_groups.cljs | 4 +--- src/status_im/new_group/handlers.cljs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/status_im/data_store/realm/contact_groups.cljs b/src/status_im/data_store/realm/contact_groups.cljs index bdf43f6936..07b57d5987 100644 --- a/src/status_im/data_store/realm/contact_groups.cljs +++ b/src/status_im/data_store/realm/contact_groups.cljs @@ -42,9 +42,7 @@ (defn- save-contacts [identities contacts] (doseq [contact-identity identities] - (if-let [contact (.find contacts (fn [object _ _] - (= contact-identity (aget object "identity"))))] - (.push contacts (clj->js {:identity contact-identity}))))) + (.push contacts (clj->js {:identity contact-identity})))) (defn add-contacts [group-id identities] diff --git a/src/status_im/new_group/handlers.cljs b/src/status_im/new_group/handlers.cljs index 499ca6fa21..b62e27f7e2 100644 --- a/src/status_im/new_group/handlers.cljs +++ b/src/status_im/new_group/handlers.cljs @@ -284,7 +284,7 @@ (fn [db [_ new-groups]] (-> db (update :contact-groups merge (map #(vector (:group-id %) %) new-groups)) - (assoc db :new-groups new-groups)))) + (assoc :new-groups new-groups)))) (register-handler :save-group-order (u/side-effect! @@ -317,7 +317,7 @@ (defn add-selected-contacts-to-group [{:keys [selected-contacts contact-groups contact-group-id] :as db} _] (let [new-identities (mapv #(hash-map :identity %) selected-contacts)] - (update db [:contact-groups contact-group-id :contacts] concat new-identities))) + (update-in db [:contact-groups contact-group-id :contacts] concat new-identities))) (defn add-selected-contacts-to-group! [{:keys [contact-group-id selected-contacts]} _]