Skip to content

Commit

Permalink
addressed feedback from @flexsurfer
Browse files Browse the repository at this point in the history
  • Loading branch information
qfrank committed Aug 28, 2023
1 parent 5768565 commit e30aafe
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ TWO_MINUTES_SYNCING=1
SWAP_ENABLED=1
STICKERS_TEST_ENABLED=1
LOCAL_PAIRING_ENABLED=1
TEST_STATEOFUS=1
11 changes: 6 additions & 5 deletions src/status_im/ens/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@
(rf/defn save-username
{:events [::save-username]}
[{:keys [db] :as cofx} custom-domain? username redirectToSummary]
(let [name (fullname custom-domain? username)
names (get-in db [:ens/names] [])
(let [name (fullname custom-domain? username)
names (get-in db [:ens/names] [])
chain-id (ethereum/chain-id db)]
(rf/merge cofx
{:json-rpc/call [{:method "ens_add"
:params [chain-id name]
{:json-rpc/call [{:method "ens_add"
:params [chain-id name]
:on-success #(rf/dispatch [:ens/get-ens-usernames])
:on-error #(log/error "Failed to add ens name" {:chain-id chain-id :name name :error %})}]}
:on-error #(log/error "Failed to add ens name"
{:chain-id chain-id :name name :error %})}]}
#(when redirectToSummary
{:dispatch [::redirect-to-ens-summary]})
#(when (empty? names)
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/signing/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

(rf/defn send-transaction
{:events [:signing.ui/sign-is-pressed]}
[{{:keys [:signing/sign :signing/tx :ens/registration] :as db} :db :as cofx}]
[{{:signing/keys [sign tx] :ens/keys [registration] :as db} :db :as cofx}]
(let [{:keys [in-progress? password]} sign
{:keys [tx-obj gas gasPrice maxPriorityFeePerGas
maxFeePerGas message nonce]} tx
Expand Down
2 changes: 1 addition & 1 deletion src/status_im2/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
(def database-management-enabled? (enabled? (get-config :DATABASE_MANAGEMENT_ENABLED "0")))
(def debug-webview? (enabled? (get-config :DEBUG_WEBVIEW "0")))
(def collectibles-enabled? (enabled? (get-config :COLLECTIBLES_ENABLED "1")))
(def test-stateofus? (enabled? (get-config :TEST_STATEOFUS "1")))
(def test-stateofus? (enabled? (get-config :TEST_STATEOFUS "0")))
(def two-minutes-syncing? (enabled? (get-config :TWO_MINUTES_SYNCING "0")))
(def swap-enabled? (enabled? (get-config :SWAP_ENABLED "0")))
(def stickers-test-enabled? (enabled? (get-config :STICKERS_TEST_ENABLED "0")))
Expand Down
15 changes: 8 additions & 7 deletions src/status_im2/subs/ens.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,14 @@
:<- [:ens/preferred-name]
:<- [:ens/registrations]
(fn [[names multiaccount preferred-name registrations]]
(let [names (keys names)
in-progress-names (reduce (fn [acc {:keys [username custom-domain?]}]
(let [full-name (ens/fullname custom-domain? username)]
(conj acc full-name)))
#{}
(vals registrations))]
{:names (remove #(contains? in-progress-names %) names)
(let [names (keys names)
in-progress-names (reduce (fn [acc {:keys [username custom-domain?]}]
(let [full-name (ens/fullname custom-domain? username)]
(conj acc full-name)))
#{}
(vals registrations))
not-in-progress-names (remove #(contains? in-progress-names %) names)]
{:names not-in-progress-names
:profile/profile multiaccount
:preferred-name preferred-name
:registrations registrations})))

0 comments on commit e30aafe

Please sign in to comment.