From 8269d6d9a9ab7934622aa826200e59febf98384b Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Wed, 11 Oct 2017 18:10:06 +0300 Subject: [PATCH] hide old wallet Dapp #2021 --- resources/default_contacts.json | 6 ------ src/status_im/chat/events.cljs | 6 ++++-- src/status_im/ui/screens/contacts/events.cljs | 10 +++++++--- test/cljs/status_im/test/contacts/events.cljs | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/default_contacts.json b/resources/default_contacts.json index 34d2172047..cd8238c3be 100644 --- a/resources/default_contacts.json +++ b/resources/default_contacts.json @@ -33,14 +33,8 @@ "ru": "Кошелек" }, "photo-path": "icon_wallet_avatar", - "add-chat?": true, "dapp?": true, - "groups": ["dapps"], "has-global-command?": true, - "dapp-url": - { - "en": "https://status.im/dapps/wallet/" - }, "bot-url": "local://wallet-bot", "unremovable?": true }, diff --git a/src/status_im/chat/events.cljs b/src/status_im/chat/events.cljs index 5f68a347f8..7f4db2b605 100644 --- a/src/status_im/chat/events.cljs +++ b/src/status_im/chat/events.cljs @@ -180,11 +180,13 @@ (let [chats (->> all-stored-chats (map (fn [{:keys [chat-id] :as chat}] [chat-id (assoc chat :last-message (get-last-stored-message chat-id))])) - (into {}))] + (into {})) + ;;TODO temporary hide wallet chat, this code should be deleted after wallet contact will be deleted + chats' (dissoc chats "wallet")] (-> new-db (assoc-in [:message-data :preview] message-previews) (assoc :handler-data (handler-data/get-all)) - (assoc :chats chats) + (assoc :chats chats') (init-console-chat true) (update :dispatch-n conj event))))))) diff --git a/src/status_im/ui/screens/contacts/events.cljs b/src/status_im/ui/screens/contacts/events.cljs index cb5422ac21..7fb898d388 100644 --- a/src/status_im/ui/screens/contacts/events.cljs +++ b/src/status_im/ui/screens/contacts/events.cljs @@ -278,10 +278,14 @@ (assoc :bot id :type :command))])) (into {})) - contacts (into {} contacts-list)] - {:db (assoc db :contacts/contacts contacts + contacts (into {} contacts-list) + ;;TODO temporary hide wallet contact, this code should be deleted after wallet contact will be deleted + contacts' (if (get-in contacts "wallet") + (assoc-in contacts ["wallet" :pending?] true) + contacts)] + {:db (assoc db :contacts/contacts contacts' :global-commands global-commands) - :dispatch-n (mapv (fn [_ contact] [:watch-contact contact]) contacts)}))) + :dispatch-n (mapv (fn [_ contact] [:watch-contact contact]) contacts')}))) (defn add-contacts "Creates effects map for adding contacts" diff --git a/test/cljs/status_im/test/contacts/events.cljs b/test/cljs/status_im/test/contacts/events.cljs index 63cf297c5c..67b1ec6c67 100644 --- a/test/cljs/status_im/test/contacts/events.cljs +++ b/test/cljs/status_im/test/contacts/events.cljs @@ -123,13 +123,13 @@ {:address nil :name "Wallet" :global-command nil - :dapp-url "https://status.im/dapps/wallet/" :dapp-hash nil :photo-path "icon_wallet_avatar" + :dapp-url nil :bot-url nil - :pending? false :whisper-identity "wallet" :dapp? true + :pending? false :unremovable? true :public-key nil})