Skip to content

Commit

Permalink
[Fixed #8008] Fixed DApps permission regression
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluard committed Apr 22, 2019
1 parent 8482ea5 commit 7b32783
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/status_im/contact/subs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,28 @@
acc))
{}
contacts)))

(re-frame/reg-sub
::dapps
(fn [db]
(:contacts/dapps db)))

(re-frame/reg-sub
:contacts/all-dapps
:<- [::dapps]
:<- [:account/account]
(fn [[dapps {:keys [dev-mode?]}]]
(map (fn [m] (update m :data #(contact.db/filter-dapps % dev-mode?))) dapps)))

(re-frame/reg-sub
:contacts/dapps-by-name
:<- [:contacts/all-dapps]
(fn [dapps]
(reduce (fn [dapps-by-name category]
(merge dapps-by-name
(reduce (fn [acc {:keys [name] :as dapp}]
(assoc acc name dapp))
{}
(:data category))))
{}
dapps)))

0 comments on commit 7b32783

Please sign in to comment.