Skip to content

Commit

Permalink
Fix broken spec validator for screen params
Browse files Browse the repository at this point in the history
Signed-off-by: Goran Jovic <goranjovic@gmail.com>
  • Loading branch information
foopang authored and goranjovic committed Feb 15, 2018
1 parent d12c9b0 commit ce34bb4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/status_im/ui/screens/add_new/open_dapp/navigation.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(:require [status-im.ui.screens.navigation :as navigation]))

(defmethod navigation/preload-data! :dapp-description
[db [_ _ dapp]]
(assoc db :new/open-dapp dapp))
[db [_ _ {:keys [dapp]}]]
(assoc db :new/open-dapp dapp))
2 changes: 1 addition & 1 deletion src/status_im/ui/screens/add_new/open_dapp/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

(defn render-row [row _ _]
[contact-view/contact-view {:contact row
:on-press #(re-frame/dispatch [:navigate-to :dapp-description row])
:on-press #(re-frame/dispatch [:navigate-to :dapp-description {:dapp row}])
:show-forward? true}])

(views/defview open-dapp []
Expand Down
36 changes: 20 additions & 16 deletions src/status_im/ui/screens/db.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,31 @@
;; navigation screen params
(spec/def :navigation.screen-params/network-details (allowed-keys :req [:networks/selected-network]))
(spec/def :navigation.screen-params/browser (allowed-keys :req [:browser/browser-id]))
(spec/def :navigation.screen-params/contact (spec/nilable map?))
(spec/def :navigation.screen-params/qr-source (spec/nilable keyword?))
(spec/def :navigation.screen-params/qr-value (spec/nilable string?))
(spec/def :navigation.screen-params/qr-viewer (allowed-keys :opt-un [:navigation.screen-params/contact
:navigation.screen-params/qr-source
:navigation.screen-params/qr-value]))
(spec/def :navigation.screen-params/current-qr-context (spec/nilable any?))
(spec/def :navigation.screen-params/qr-scanner (allowed-keys :opt-un [:navigation.screen-params/current-qr-context]))
(spec/def :navigation.screen-params/show-search? (spec/nilable any?))
(spec/def :navigation.screen-params.profile-qr-viewer/contact (spec/nilable map?))
(spec/def :navigation.screen-params.profile-qr-viewer/source (spec/nilable keyword?))
(spec/def :navigation.screen-params.profile-qr-viewer/value (spec/nilable string?))
(spec/def :navigation.screen-params/profile-qr-viewer (allowed-keys :opt-un [:navigation.screen-params.profile-qr-viewer/contact
:navigation.screen-params.profile-qr-viewer/source
:navigation.screen-params.profile-qr-viewer/value]))
(spec/def :navigation.screen-params.qr-scanner/current-qr-context (spec/nilable any?))
(spec/def :navigation.screen-params/qr-scanner (allowed-keys :opt-un [:navigation.screen-params.qr-scanner/current-qr-context]))
(spec/def :navigation.screen-params.group-contacts/show-search? (spec/nilable any?))
(spec/def :navigation.screen-params/group-contacts (allowed-keys :opt [:group/contact-group-id]
:opt-un [:navigation.screen-params/show-search?]))
(spec/def :navigation.screen-params/group (spec/nilable any?))
(spec/def :navigation.screen-params/group-type (spec/nilable any?))
(spec/def :navigation.screen-params/edit-contact-group (allowed-keys :opt-un [:navigation.screen-params/group
:navigation.screen-params/group-type]))
:opt-un [:navigation.screen-params.group-contacts/show-search?]))
(spec/def :navigation.screen-params.edit-contact-group/group (spec/nilable any?))
(spec/def :navigation.screen-params.edit-contact-group/group-type (spec/nilable any?))
(spec/def :navigation.screen-params/edit-contact-group (allowed-keys :opt-un [:navigation.screen-params.edit-contact-group/group
:navigation.screen-params.edit-contact-group/group-type]))
(spec/def :navigation.screen-params.dapp-description/dapp :new/open-dapp)
(spec/def :navigation.screen-params/dapp-description (allowed-keys :opt-un [:navigation.screen-params.dapp-description/dapp]))

(spec/def :navigation/screen-params (spec/nilable (allowed-keys :opt-un [:navigation.screen-params/network-details
:navigation.screen-params/browser
:navigation.screen-params/qr-viewer
:navigation.screen-params/profile-qr-viewer
:navigation.screen-params/qr-scanner
:navigation.screen-params/group-contacts
:navigation.screen-params/edit-contact-group])))
:navigation.screen-params/edit-contact-group
:navigation.screen-params/dapp-description])))

;;;;NETWORK

Expand Down

0 comments on commit ce34bb4

Please sign in to comment.