diff --git a/src/legacy/status_im/ethereum/subscriptions.cljs b/src/legacy/status_im/ethereum/subscriptions.cljs index 986105be5e..ee5c6d9865 100644 --- a/src/legacy/status_im/ethereum/subscriptions.cljs +++ b/src/legacy/status_im/ethereum/subscriptions.cljs @@ -89,4 +89,5 @@ "wallet-get-collectibles-details-done" {:fx [[:dispatch [:wallet/get-collectible-details-done event]]]} + "wallet-tick-reload" {:fx [[:dispatch [:wallet/reload]]]} (log/debug ::unknown-wallet-event :type type :event event))) diff --git a/src/status_im/contexts/wallet/events.cljs b/src/status_im/contexts/wallet/events.cljs index 394aa60f28..4015492e53 100644 --- a/src/status_im/contexts/wallet/events.cljs +++ b/src/status_im/contexts/wallet/events.cljs @@ -327,9 +327,23 @@ {:fx [[:dispatch [:hide-bottom-sheet]] [:dispatch [:browser.ui/open-url (str explorer-link "/" address)]]]})) +(rf/reg-event-fx :wallet/reload + (fn [_] + {:fx [[:dispatch-n [[:wallet/get-wallet-token]]]]})) + +(rf/reg-event-fx :wallet/start-wallet + (fn [_] + {:fx [[:json-rpc/call + [{:method "wallet_startWallet" + :on-error #(log/info "failed to start wallet" + {:error % + :event :wallet/start-wallet})}]]]})) + (rf/reg-event-fx :wallet/initialize (fn [] - {:fx [[:dispatch-n [[:wallet/get-ethereum-chains] [:wallet/get-accounts]]]]})) + {:fx [[:dispatch [:wallet/start-wallet]] + [:dispatch [:wallet/get-ethereum-chains]] + [:dispatch [:wallet/get-accounts]]]})) (rf/reg-event-fx :wallet/share-account (fn [_ [{:keys [content title]}]]