mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-14 02:35:54 +00:00
[#10868] ENS name is pending when tx has failed
Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
parent
ac74cf01c5
commit
49744d89de
@ -303,3 +303,18 @@
|
||||
(fx/merge cofx
|
||||
(set-username-candidate (get-in db [:ens/registration :username] ""))
|
||||
(navigation/navigate-to-cofx :ens-search {})))
|
||||
|
||||
(fx/defn remove-username
|
||||
{:events [::remove-username]}
|
||||
[{:keys [db] :as cofx} name]
|
||||
(let [names (get-in db [:multiaccount :usernames] [])
|
||||
preferred-name (get-in db [:multiaccount :preferred-name])
|
||||
new-names (remove #(= name %) names)]
|
||||
(fx/merge cofx
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:usernames new-names
|
||||
{})
|
||||
(when (= name preferred-name)
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:preferred-name (first new-names) {}))
|
||||
(navigation/navigate-back))))
|
@ -509,15 +509,18 @@
|
||||
[section {:title (i18n/label :t/key)
|
||||
:content public-key}]])
|
||||
[react/view {:style {:margin-top 16 :margin-bottom 32}}
|
||||
;;TODO: re-enable once feature is developped
|
||||
#_[list/big-list-item {:text (i18n/label :t/ens-remove-username)
|
||||
:subtext (i18n/label :t/ens-remove-hints)
|
||||
:text-color colors/gray
|
||||
;;TODO this is temporary fix for accounts with failed txs
|
||||
;;we still need this for regular ens names (not pending) but we need to detach public key in the contract
|
||||
(when pending?
|
||||
[list/big-list-item {:text (i18n/label :t/ens-remove-username)
|
||||
;:subtext (i18n/label :t/ens-remove-hints)
|
||||
:text-color colors/red
|
||||
:text-style {:font-weight "500"}
|
||||
:icon :main-icons/close
|
||||
:icon-color colors/gray
|
||||
:hide-chevron? true}]
|
||||
(when-not custom-domain?
|
||||
:icon-color colors/red
|
||||
:hide-chevron? true
|
||||
:action-fn #(re-frame/dispatch [::ens/remove-username name])}])
|
||||
(when (and (not custom-domain?) (not pending?))
|
||||
[react/view {:style {:margin-top 18}}
|
||||
[list/big-list-item {:text (i18n/label :t/ens-release-username)
|
||||
:text-color (if releasable?
|
||||
|
Loading…
x
Reference in New Issue
Block a user