fix(wallet): saved addresses - navigation on save and ens fixes (#20462)
This commit: - fixes addresses are displayed without truncation - fixes network preference (advanced icon) shown for ENS - fixes navigation on adding a new saved address Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
This commit is contained in:
parent
8b424b0669
commit
686f6bdf5e
|
@ -156,7 +156,7 @@
|
|||
(rf/dispatch
|
||||
[:wallet/set-address-to-save
|
||||
{:address address
|
||||
:ens address-or-ens
|
||||
:ens (when ens-name? address-or-ens)
|
||||
:ens? ens-name?}])
|
||||
(rf/dispatch
|
||||
[:open-modal :screen/settings.save-address]))
|
||||
|
|
|
@ -90,7 +90,8 @@
|
|||
(defn add-saved-address-success
|
||||
[_ [toast-message]]
|
||||
{:fx [[:dispatch [:wallet/get-saved-addresses]]
|
||||
[:dispatch [:navigate-back-to :screen/settings.saved-addresses]]
|
||||
[:dispatch [:dismiss-modal :screen/settings.add-address-to-save]]
|
||||
[:dispatch [:dismiss-modal :screen/settings.save-address]]
|
||||
[:dispatch-later
|
||||
{:ms 100
|
||||
:dispatch [:toasts/upsert
|
||||
|
@ -103,7 +104,7 @@
|
|||
(defn edit-saved-address-success
|
||||
[_]
|
||||
{:fx [[:dispatch [:wallet/get-saved-addresses]]
|
||||
[:dispatch [:navigate-back]]
|
||||
[:dispatch [:dismiss-modal :screen/settings.edit-saved-address]]
|
||||
[:dispatch-later
|
||||
{:ms 100
|
||||
:dispatch [:toasts/upsert
|
||||
|
|
|
@ -152,14 +152,15 @@
|
|||
effects (events/add-saved-address-success cofx [toast-message])
|
||||
result-fx (:fx effects)
|
||||
expected-fx [[:dispatch [:wallet/get-saved-addresses]]
|
||||
[:dispatch [:navigate-back-to :screen/settings.saved-addresses]]
|
||||
[:dispatch [:dismiss-modal :screen/settings.add-address-to-save]]
|
||||
[:dispatch [:dismiss-modal :screen/settings.save-address]]
|
||||
[:dispatch-later
|
||||
{:ms 100
|
||||
:dispatch [:toasts/upsert
|
||||
{:type :positive
|
||||
:theme :dark
|
||||
:text toast-message}]}]]]
|
||||
(is (= (count result-fx) 3))
|
||||
(is (= (count result-fx) 4))
|
||||
(is (match? expected-fx result-fx)))))
|
||||
|
||||
(deftest edit-saved-address-success-test
|
||||
|
@ -169,7 +170,7 @@
|
|||
effects (events/edit-saved-address-success cofx)
|
||||
result-fx (:fx effects)
|
||||
expected-fx [[:dispatch [:wallet/get-saved-addresses]]
|
||||
[:dispatch [:navigate-back]]
|
||||
[:dispatch [:dismiss-modal :screen/settings.edit-saved-address]]
|
||||
[:dispatch-later
|
||||
{:ms 100
|
||||
:dispatch [:toasts/upsert
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
:on-error
|
||||
[:wallet/add-saved-address-failed]
|
||||
:name address-label
|
||||
:ens ens
|
||||
:ens (when ens? ens)
|
||||
:address address-without-prefix
|
||||
:customization-color address-color
|
||||
:chain-short-names chain-short-names}]))
|
||||
|
@ -93,7 +93,7 @@
|
|||
:subtitle-type :default
|
||||
:label :none
|
||||
:blur? true
|
||||
:icon-right? true
|
||||
:icon-right? (not ens?)
|
||||
:right-icon :i/advanced
|
||||
:card? true
|
||||
:title (i18n/label :t/address)
|
||||
|
|
|
@ -46,6 +46,8 @@
|
|||
{:address address
|
||||
:chain-short-names chain-short-names
|
||||
:full-address full-address
|
||||
:ens? ens?
|
||||
:ens ens
|
||||
:name name
|
||||
:network-preferences-names
|
||||
network-preferences-names
|
||||
|
|
Loading…
Reference in New Issue