* fix issue * move navigation to the event * move clearing to hook * revert scroll_page * resolve comment * fix duplicate navigation
This commit is contained in:
parent
ae08cb161f
commit
c7aa10c789
|
@ -19,8 +19,7 @@
|
|||
:collectibles [collectibles/view
|
||||
{:collectibles collectible-list
|
||||
:on-collectible-press (fn [{:keys [id]}]
|
||||
(rf/dispatch [:wallet/get-collectible-details id])
|
||||
(rf/dispatch [:navigate-to :wallet-collectible]))}]
|
||||
(rf/dispatch [:wallet/get-collectible-details id]))}]
|
||||
:activity [activity/view]
|
||||
:permissions [empty-tab/view
|
||||
{:title (i18n/label :t/no-permissions)
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
:label (i18n/label :t/share-collectible)
|
||||
:right-icon :i/external}]]]))
|
||||
|
||||
(defn view-internal
|
||||
(defn f-view-internal
|
||||
[{:keys [theme] :as _props}]
|
||||
(let [selected-tab (reagent/atom :overview)
|
||||
on-tab-change #(reset! selected-tab %)]
|
||||
|
@ -116,6 +116,10 @@
|
|||
{collection-image :image-url
|
||||
collection-name :name} collection-data
|
||||
{collectible-name :name} collectible-data]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
#(rf/dispatch [:wallet/clear-last-collectible-details]))
|
||||
[])
|
||||
[scroll-page/scroll-page
|
||||
{:navigate-back? true
|
||||
:height 148
|
||||
|
@ -177,4 +181,8 @@
|
|||
:data tabs-data}]
|
||||
[tabs/view {:selected-tab @selected-tab}]]]))))
|
||||
|
||||
(defn- view-internal
|
||||
[props]
|
||||
[:f> f-view-internal props])
|
||||
|
||||
(def view (quo.theme/with-theme view-internal))
|
||||
|
|
|
@ -56,7 +56,8 @@
|
|||
|
||||
(defn store-last-collectible-details
|
||||
[{:keys [db]} [collectible]]
|
||||
{:db (assoc-in db [:wallet :last-collectible-details] collectible)})
|
||||
{:db (assoc-in db [:wallet :last-collectible-details] collectible)
|
||||
:dispatch [:navigate-to :wallet-collectible]})
|
||||
|
||||
(rf/reg-event-fx :wallet/store-last-collectible-details store-last-collectible-details)
|
||||
|
||||
|
@ -126,3 +127,8 @@
|
|||
(log/error "failed to get collectible details"
|
||||
{:event :wallet/get-collectible-details-done
|
||||
:response response})))))
|
||||
|
||||
(rf/reg-event-fx
|
||||
:wallet/clear-last-collectible-details
|
||||
(fn [{:keys [db]}]
|
||||
{:db (update-in db [:wallet] dissoc :last-collectible-details)}))
|
||||
|
|
|
@ -16,6 +16,5 @@
|
|||
:collectibles [collectibles/view
|
||||
{:collectibles collectible-list
|
||||
:on-collectible-press (fn [{:keys [id]}]
|
||||
(rf/dispatch [:wallet/get-collectible-details id])
|
||||
(rf/dispatch [:navigate-to :wallet-collectible]))}]
|
||||
(rf/dispatch [:wallet/get-collectible-details id]))}]
|
||||
[activity/view])]))
|
||||
|
|
Loading…
Reference in New Issue