From 6d4c611db12fc0a1e033efe6050fcfed51e2c6cb Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Mon, 30 Apr 2018 11:20:13 +0300 Subject: [PATCH] added simple dapp in dev mode Signed-off-by: Andrey Shovkoplyas --- resources/default_contacts.json | 7 ++++++- src/status_im/ui/screens/contacts/subs.cljs | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/resources/default_contacts.json b/resources/default_contacts.json index 89b756b465..6111ff2293 100644 --- a/resources/default_contacts.json +++ b/resources/default_contacts.json @@ -191,6 +191,11 @@ "dapp-url": {"en" : "https://cryptofighters.io"}, "dapp?": true, "photo-path": "contacts://cryptofighters" + }, + "simple-dapp": { + "name" : {"en" : "Simple Dapp"}, + "description": "Request test assets and test basic web3 functionality.", + "dapp-url": {"en" : "https://status-im.github.io/dapp/"}, + "dapp?": true } - } diff --git a/src/status_im/ui/screens/contacts/subs.cljs b/src/status_im/ui/screens/contacts/subs.cljs index 96b230bc8e..37c025cb82 100644 --- a/src/status_im/ui/screens/contacts/subs.cljs +++ b/src/status_im/ui/screens/contacts/subs.cljs @@ -43,8 +43,11 @@ (reg-sub :all-dapp-with-url-contacts :<- [:all-added-contacts] - (fn [contacts] - (filter #(and (:dapp? %) (:dapp-url %)) contacts))) + :<- [:get-current-account] + (fn [[contacts {:keys [dev-mode?]}]] + (filter #(and (:dapp? %) (:dapp-url %) (or dev-mode? + (not= "simple-dapp" (:whisper-identity %)))) + contacts))) (reg-sub :get-people-in-current-chat :<- [:get-current-chat-contacts]