Skip to content

Commit afa6b3b

Browse files
committed
lint
1 parent 3f6adb2 commit afa6b3b

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

src/status_im/contexts/wallet/create_account/new_keypair/backup_recovery_phrase/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
secret-phrase (reagent/atom [])
5050
random-phrase (reagent/atom [])]
5151
(fn []
52-
(rn/use-effect
52+
(rn/use-mount
5353
(fn []
5454
(native-module/get-random-mnemonic #(reset! secret-phrase (string/split % #"\s")))
5555
(native-module/get-random-mnemonic #(reset! random-phrase (string/split % #"\s")))))

src/status_im/contexts/wallet/create_account/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
{window-width :width} (rn/get-window)]
6666
(fn [{:keys [theme]}]
6767
(let [{:keys [new-keypair]} (rf/sub [:wallet/create-account])]
68-
(rn/use-effect (fn [] #(rf/dispatch [:wallet/clear-new-keypair])))
68+
(rn/use-unmount #(rf/dispatch [:wallet/clear-new-keypair]))
6969
[rn/view {:style {:flex 1}}
7070
[quo/page-nav
7171
{:type :no-title

src/status_im/contexts/wallet/events.cljs

+20-6
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,14 @@
207207

208208
(defn add-keypair-and-create-account
209209
[_ [{:keys [sha3-pwd new-keypair]}]]
210-
{:fx [[:json-rpc/call
211-
[{:method "accounts_addKeypair"
212-
:params [sha3-pwd new-keypair]
213-
:on-success [:wallet/add-account-success (comp string/lower-case (:address new-keypair))]
214-
:on-error #(log/info "failed to create keypair " %)}]]]})
210+
(let [lowercase-address (if (:address new-keypair)
211+
(string/lower-case (:address new-keypair))
212+
(:address new-keypair))]
213+
{:fx [[:json-rpc/call
214+
[{:method "accounts_addKeypair"
215+
:params [sha3-pwd new-keypair]
216+
:on-success [:wallet/add-account-success lowercase-address]
217+
:on-error #(log/info "failed to create keypair " %)}]]]}))
215218

216219
(rf/reg-event-fx :wallet/add-keypair-and-create-account add-keypair-and-create-account)
217220

@@ -226,9 +229,20 @@
226229
(rf/reg-event-fx :wallet/get-keypairs get-keypairs)
227230

228231

232+
(defn rename-color-id-in-data
233+
[data]
234+
(map (fn [item]
235+
(update item
236+
:accounts
237+
(fn [accounts]
238+
(map (fn [account]
239+
(set/rename-keys account {:color-id :customization-color}))
240+
accounts))))
241+
data))
242+
229243
(defn get-keypairs-success
230244
[{:keys [db]} [keypairs]]
231-
(let [renamed-data (set/rename-keys keypairs {:colorId :customization-color})]
245+
(let [renamed-data (rename-color-id-in-data keypairs)]
232246
{:db (assoc-in db [:wallet :keypairs] (cske/transform-keys csk/->kebab-case-keyword renamed-data))}))
233247

234248
(rf/reg-event-fx :wallet/get-keypairs-success get-keypairs-success)

0 commit comments

Comments
 (0)