Skip to content

Commit

Permalink
[#8008] Error "No protocol method IDeref.-deref defined for type unde…
Browse files Browse the repository at this point in the history
…fined:" and crash if open DApp permissions

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
  • Loading branch information
flexsurfer committed Apr 24, 2019
1 parent 0d2be79 commit 722fd67
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/status_im/ui/screens/dapps_permissions/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@
[react/view styles/icon-container
[icons/icon :main-icons/dapp {:color colors/gray}]])

(defn prepare-items [dapps]
(fn [{:keys [dapp permissions]}]
(merge
{:title dapp
:accessories [:chevron]
:on-press #(re-frame/dispatch [:navigate-to :manage-dapps-permissions {:dapp dapp :permissions permissions}])}
(let [path (get-in dapps [dapp :photo-path])]
(if path
{:image-path path}
{:image d-icon})))))
(defn prepare-items [{:keys [dapp permissions]}]
{:title dapp
:accessories [:chevron]
:on-press #(re-frame/dispatch [:navigate-to :manage-dapps-permissions {:dapp dapp :permissions permissions}])
:image d-icon})

(defn prepare-items-manage [permission]
{:title (case permission
Expand All @@ -36,14 +31,13 @@
:accessories [:check]})

(views/defview dapps-permissions []
(views/letsubs [permissions [:get :dapps/permissions]
dapps [:contacts/dapps-by-name]]
(views/letsubs [permissions [:get :dapps/permissions]]
[react/view {:flex 1 :background-color colors/white}
[status-bar/status-bar]
[toolbar/simple-toolbar
(i18n/label :t/dapps-permissions)]
[list/flat-list
{:data (map (prepare-items dapps) (vals permissions))
{:data (map prepare-items (vals permissions))
:key-fn (fn [_ i] (str i))
:render-fn list-item/list-item}]]))

Expand All @@ -57,5 +51,5 @@
:key-fn (fn [_ i] (str i))
:render-fn list-item/list-item}]
[react/view {:padding-vertical 16}
[components.common/red-button {:label (i18n/label :t/revoke-access)
[components.common/red-button {:label (i18n/label :t/revoke-access)
:on-press #(re-frame/dispatch [:dapps/revoke-access dapp])}]]]))

0 comments on commit 722fd67

Please sign in to comment.