mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-28 01:16:50 +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
|
(fx/merge cofx
|
||||||
(set-username-candidate (get-in db [:ens/registration :username] ""))
|
(set-username-candidate (get-in db [:ens/registration :username] ""))
|
||||||
(navigation/navigate-to-cofx :ens-search {})))
|
(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)
|
[section {:title (i18n/label :t/key)
|
||||||
:content public-key}]])
|
:content public-key}]])
|
||||||
[react/view {:style {:margin-top 16 :margin-bottom 32}}
|
[react/view {:style {:margin-top 16 :margin-bottom 32}}
|
||||||
;;TODO: re-enable once feature is developped
|
;;TODO this is temporary fix for accounts with failed txs
|
||||||
#_[list/big-list-item {:text (i18n/label :t/ens-remove-username)
|
;;we still need this for regular ens names (not pending) but we need to detach public key in the contract
|
||||||
:subtext (i18n/label :t/ens-remove-hints)
|
(when pending?
|
||||||
:text-color colors/gray
|
[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"}
|
:text-style {:font-weight "500"}
|
||||||
:icon :main-icons/close
|
:icon :main-icons/close
|
||||||
:icon-color colors/gray
|
:icon-color colors/red
|
||||||
:hide-chevron? true}]
|
:hide-chevron? true
|
||||||
(when-not custom-domain?
|
:action-fn #(re-frame/dispatch [::ens/remove-username name])}])
|
||||||
|
(when (and (not custom-domain?) (not pending?))
|
||||||
[react/view {:style {:margin-top 18}}
|
[react/view {:style {:margin-top 18}}
|
||||||
[list/big-list-item {:text (i18n/label :t/ens-release-username)
|
[list/big-list-item {:text (i18n/label :t/ens-release-username)
|
||||||
:text-color (if releasable?
|
:text-color (if releasable?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user